Refresh causing unwanted HTML Form processing in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Steve Lawson
Forum Newbie
Posts: 2
Joined: Wed Jul 17, 2002 9:28 pm
Location: Simi Valley, CA, USA
Contact:

Refresh causing unwanted HTML Form processing in PHP

Post by Steve Lawson »

Is there a way to tell (using pure PHP -- or, perhaps even, JavaScript with PHP)) the difference between a page that was loaded (reloaded) by the Browsers 'Refresh' button and that was loaded from a Submit button on a different page (or even on the same page)? I'm having a problem with the 'get' data in the URL being applied again when the Refresh button is pressed.
Would this be a job for Session handling functions (which I just discovered but don't quite know how to use)?
ssand
Forum Commoner
Posts: 72
Joined: Sat Jun 22, 2002 9:25 pm
Location: Iowa

Post by ssand »

I ran into the same problem a couple days ago.

My form was short, so I eventually ended up dumping all my PHP to process the form on a separate page and then depending on the result sent the user to the correct page.

or Have you tried using unset()??
I doubt it will clear the data in the URL on refresh, but it's worth a try.
Post Reply