943,832 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 4082
  • PHP RSS
Nov 15th, 2008
0

POST data submit in page refresh

Expand Post »
Hi,

If I refresh a page than post values are also submitting repeatedly...........

how to solve this problem....
Similar Threads
Reputation Points: 8
Solved Threads: 2
Junior Poster in Training
nil_gh_80 is offline Offline
64 posts
since Aug 2007
Nov 15th, 2008
0

Re: POST data submit in page refresh

Post your code. We cant tell the problems unless you post your codes.
PoA
Reputation Points: 19
Solved Threads: 9
Posting Whiz in Training
PoA is offline Offline
234 posts
since Jul 2004
Nov 17th, 2008
0

Re: POST data submit in page refresh

Click to Expand / Collapse  Quote originally posted by nil_gh_80 ...
Hi,

If I refresh a page than post values are also submitting repeatedly...........

how to solve this problem....
What you’re doing is essentially submitting the data again.

You could check whether or not the submit button was actioned:

if (isset($_POST['Submit'])) {
Name your submit button 'Submit'

Thats one way of doing it.
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
darren2005 is offline Offline
58 posts
since Mar 2007
Nov 17th, 2008
0

Re: POST data submit in page refresh

One thing you can do is..


its obvious that on pressing submit u have performed a task
for e.g updating a databse or something...

Just put a condition if the task has been executed successfully., i.e redirect to the same page or any other page on success.

if(opertion success)
{
// redirect to the same/some page.
}


now if u hit refresh the whole page wil b loaded again.
Reputation Points: 8
Solved Threads: 0
Newbie Poster
bhavik_thegame is offline Offline
11 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: general php help
Next Thread in PHP Forum Timeline: cURL problems





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC