Forum Moderators: coopster

Message Too Old, No Replies

Disable caching

         

stidj

4:31 am on Nov 9, 2003 (gmt 0)

10+ Year Member



Hey guys,

I am trying to disable caching on my forms but can't.

I have tried the header tricks but those do not work.

I have also used the header function in PHP and that does not work.

The error everytime is output already started by .......

Does anyone know an easy solution for this?

Thanks

dreamcatcher

9:04 am on Nov 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi stidj, welcome to Webmaster World.

It might be a good idea to post what code you have so that we can take a look at it and see what may be causing your problems. The PHP error "output already started by blah blah, headers already sent", isn`t necessarily to do with caching.

:)

mat_bastian

10:57 am on Nov 9, 2003 (gmt 0)

10+ Year Member



<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<!-- end no cache headers -->

I use this all the time and it works well.

stidj

3:12 pm on Nov 9, 2003 (gmt 0)

10+ Year Member



Thanks mat_bastian, it works for me too.

dreamcatcher

3:30 pm on Nov 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry, I thought you when you said you had tried all the header tricks, you had tried that already!

Glad you got it sorted. :)

stidj

5:36 am on Nov 12, 2003 (gmt 0)

10+ Year Member



Unfortunately the solution seems to not work anymore. At first it seemed to now it is not. For some reason if I go back to the URL of this code it will act as if I have clicked submit even if I refresh. Keep in mind my form will remember what values were correct and fill them in, in their respective input areas.

My code is in this style

if ( $_POST['Submit'] )
{
if ( validatedok )
{
echo some error msgs
}
else
{
do other stuff
}
}

if ( not validated above then show form )
{
<HTMLFORM>
</HTMLFORM>
}