I was wondering if there is a way to ensure that a form is only
submitted once.  I have a script that saves a lot of information to the
disk and if the user uses the back button and then resubmits the form,
it will cause major problems.  I jave looked into using javascript to
fix this, but it doesn't seem like there is an easy way using
javascript.  In the process of looking into this, someone recommended
using a session variable.  I have never used sesion variables, but tried
a sample code in the documentation:
session_register ("count");
Hello visitor, you have seen this page <?php echo $count; ?> times.<p>
# the <?=SID?> is necessary to preserve the session id
# in the case that the user has disabled cookies
To continue, <A HREF="nextpage.php?<?=SID?>">click here</A>

but I get an error saying "Warning: Cannot send session cookie - headers
already sent by (output started at
c:\server\apache\htdocs\session.phtml:5)"  and "Warning: Cannot send
session cache limiter - headers already sent (output started at
c:\server\apache\htdocs\session.phtml:5) in

So two questions, first is a sesssion variable the way to go in ensuring
that the user doesn't use the back button to resubmit a form, and
secondly why am I getting this errors when I just cut and paste the
example code into a sample page?

Thanks for any direction and help,
    Andrew V. Romero

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to