Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-08-2010, 03:41 PM   PM User | #1
treeleaf20
Regular Coder

 
Join Date: Oct 2009
Posts: 438
Thanks: 9
Thanked 7 Times in 7 Posts
treeleaf20 is an unknown quantity at this point
Prevent from Submitting Again

All,
I am submitting a form to a page and when I refresh it I want to now allow it to to submit again. I know I get a pop up box and I can control the query part by setting a variable in getting the post variables but just curious if PHP had an easier way to do this to find it a page was submitted.

Thanks in advance.
treeleaf20 is offline   Reply With Quote
Old 12-08-2010, 04:14 PM   PM User | #2
CloudWriter
New Coder

 
Join Date: Dec 2010
Posts: 61
Thanks: 12
Thanked 0 Times in 0 Posts
CloudWriter is an unknown quantity at this point
if you are using if php ($_POST) use header to redirect you back to your page - just guessing without seing the code

Code:
header("Location: ./yourpage.php");

?php if ($_POST) {echo "Form was entered correctly";} ?>

Last edited by CloudWriter; 12-08-2010 at 04:18 PM..
CloudWriter is offline   Reply With Quote
Old 12-08-2010, 09:23 PM   PM User | #3
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Set a SESSION variable ...

and check it each time before you display the form.

Google: PHP SESSION TUTORIAL
mlseim is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:28 PM.


Advertisement
Log in to turn off these ads.