Nevermind everyone. I was just being an idiot and fetching from the database
BEFORE updating it. Well maybe this will at least help some people not make
the same stupid mistake.

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 11, 2002 8:19 PM
Subject: [PHP] Cache Being Bad


I have a text box on my page and a submit button. The text box value is
whatever it grabs from the database. If the user deletes what is in the text
box and puts in his own text, then hits submit, the script updates that
field with whatever the user inputs.

Problem is, after the user hits submit, it APPEARS as though the new text
was not submitted because the old text is still in the box. Yet when he
refreshes the page it shows the new text.

Does that make sense? How do I make it so the new text shows up without him
having to refresh. Also I don't want to do a redirect because I want to
print a message "Info submitted" when the user hits submit.

I have tried:

function cache_control($maxage=0)

$Modified = "Last-modified: ".gmdate("D, d M Y H:i:s", time())." GMT";
$Expires = "Expires: ".gmdate("D, d M Y H:i:s", time() + $maxage)." GMT";
$CacheControl = "Cache-Control: must-revalidate, max-age=".$maxage.", ";
$CacheControl.= "s-max-age=".$maxage;
Header($CacheControl);
Header($Modified);
Header($Expires);
}

cache_control(0);


Thanks so much for reading,
Nate



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to