Forum Moderators: coopster

Message Too Old, No Replies

suppress reposting in php

         

OZmike

11:15 am on Jul 14, 2005 (gmt 0)

10+ Year Member



created a self posting page in php, to allow users to bid on products which refreshes every 20 seconds, so members can see any counter bids, is there a way to suppress the resend POST message which will occur if the user places a bid and then the page refreshes again?

mogenshoj

11:28 am on Jul 14, 2005 (gmt 0)

10+ Year Member



You can put something like this in the top of the page or create a seperate page for bid inserts and the redirect the user back to the original page.

if (isset($_POST[something])) {
// insert into database or whatever

header("Location: the_same_page.php");
}

OZmike

11:47 am on Jul 14, 2005 (gmt 0)

10+ Year Member



thank you, sort of works but only after you place a bid, if however you just go into the page, and then the refresh runs, then I still get the error, must be my coding, will look into it further, thank you for the help

lobo235

1:28 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



The site visitor must be arriving to the page via a POST form. Are they clicking a form button that takes them there?

OZmike

1:49 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



yes - they fill out a spec form then post that form that produces the offering catalogue, the offer catalogue is a self posting php page, to get around it for the time being I have faked a post on the page when the user first goes into the page then all is working ok, if the fake post was not done then I get the message about re posting

jatar_k

5:08 pm on Jul 14, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



all you need to do to break reposting is not have your "thank you for your input" or your coinfirmation page have the submit logic in it.

Break the chain and they can reload the final page as many times as they like

>> a self posting php page

these make for many problems of which this is one, don't do it

OZmike

1:07 am on Jul 15, 2005 (gmt 0)

10+ Year Member



Thank you for your help, got it working fine now thanks to your advise