checking if a "refresh" was done!
Moderator: General Moderators
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
checking if a "refresh" was done!
how can i check if the user pressed "F5" (refresh?)
beacuse for example if he has filled out data in a table and after i hhave aupdated he presses F5 the update will be done again!
how can i find thatout and even prevent it?
thnaks i nadvance
peleg
beacuse for example if he has filled out data in a table and after i hhave aupdated he presses F5 the update will be done again!
how can i find thatout and even prevent it?
thnaks i nadvance
peleg
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
well
press return on address bar is not the same as press refresh icon, press f5 beacuse the first one is calling the page withought sending a form variables
where as for refresh icong/f5 it is!
where as for refresh icong/f5 it is!
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
if you press return on the address bar on a page that processes $_POST information, then it resends in the $_POST variables
at least it has for as long as ive been using browsers (a long time)
it may not technically be a refresh, but you are getting back exactly the same information on exactly the same page, so i would call it a refresh
at least it has for as long as ive been using browsers (a long time)
it may not technically be a refresh, but you are getting back exactly the same information on exactly the same page, so i would call it a refresh
not since i have been using browsers it doesn'tmalcolmboston wrote:if you press return on the address bar on a page that processes $_POST information, then it resends in the $_POST variables
at least it has for as long as ive been using browsers (a long time)
Hit refresh or F5 and it does, but not return in the address bar
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
could the problem not be solved by...
then when it was refreshed, the post data would not be available?
Code: Select all
// at end of page
if (isset($_POST))
{
unset($_POST);
}- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
My normal method of preventing update is
Where url is the page again with any $_GET variables required to show the correct information.
No matter how the page is refreshed the update is not done again.
Code: Select all
if ($_REQUESTї'var']) {
//Perform Update
header("e;Location: url"e;);
exit;
}No matter how the page is refreshed the update is not done again.