Forum Moderators: coopster
if ( $_POST['Submit'] )
{
if ( validatedok )
{
echo some error msgs
}
else
{
do other stuff
}
}
if ( not validated above then show form )
{
<HTMLFORM>
</HTMLFORM>
}
For some reason if I go back to the URL of this code it will act as if I have clicked submit. Keep in mind my form will remember what values were correct and fill them in, in their respective input areas.
I have tried this code to fix it:
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
and it produces the following warnings:
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site187/fst/var/www/html/index.php:3) in /home/virtual/site187/fst/var/www/html/wholesaleadmin/entry.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site187/fst/var/www/html/index.php:3) in /home/virtual/site187/fst/var/www/html/wholesaleadmin/entry.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site187/fst/var/www/html/index.php:3) in /home/virtual/site187/fst/var/www/html/wholesaleadmin/entry.php on line 12
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site187/fst/var/www/html/index.php:3) in /home/virtual/site187/fst/var/www/html/wholesaleadmin/entry.php on line 15
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site187/fst/var/www/html/index.php:3) in /home/virtual/site187/fst/var/www/html/wholesaleadmin/entry.php on line 18
Any help would be greatly appreciated.
Thanks
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");and it produces the following warnings:
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site187/fst/var/www/html/index.php:3) in /home/virtual/site187/fst/var/www/html/wholesaleadmin/entry.php on line 10
My site is layed out with an index.php which is always part of my site. Ultimately it is like this.
index.php is like
<html>
--stuff here--
--inserted the form file here or another file--
</html>
The inserted file above always a normal html file as I use this as a way to get a dynamic design while still using static html pages.
The problem is that even if the solution above could work, I would have to enable it for the entire site and I just wanted to disable caching on this particular form.
I am also very frustated because I have tried a meta tag trick which seemed to initially work. I think this may not only be a cache problem either.
If I delete my cache and go back to the same page without closing the browser after a submit, my browser realizes the data must be reloaded but the browser seems to recall the form was submitted.
Anyone have any ideas?