Re: [PHP] Disable refresh?

2002-12-02 Thread Marek Kilimajer


Ernest E Vogelsinger wrote:


This will not stop the user from hitting the "Back" button and refreshing
the form... 

If the user wants it he can do it even with your method. My point is he 
don't do it unintentionally, so I
use just the Location method

 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Disable refresh?

2002-12-02 Thread phpnew_bocket
you can use a session :

- start the session when the form is first sent
- destroy the session upon the first valid insert
- subsequent upadates will be prevented since the
session is destroyed..

usually multiple updates happens when the user hits
the submit button several times or upon refreshing the
page ... hence the session method should work fine

good luck !

--- Larry Brown <[EMAIL PROTECTED]>
wrote:
> Anyone know of a method of preventing a user from
> refreshing a page.  I get
> multiple updates with the same information in my
> database...
> 
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
+--+
|Wana Know what ISLAM is all about ? |
+--+

visit :   http://www.sultan.org/#int

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Disable refresh?

2002-12-02 Thread Ernest E Vogelsinger
At 02:41 02.12.2002, Martin Towell said:
[snip]
>no, no way to disable and no variable to say a refresh happened
>
>one way to get around it is to submit to the page that does the update, then
>get that page to do a header("location...") to another page. When the user
>refreshes, they'll only refresh the last page, and not the updating page.
[snip] 

This will not stop the user from hitting the "Back" button and refreshing
the form... What I do (and it works flawlessly) is to have a serial number
stored in the session data. This serial number, mirrored in form data as a
hidden field, is incremented with each klick the script receives. Thus the
code handling script input is able to determine if the form it just
received is the last form it generated (serial number matches), or is
outdated (serial number mismatches), for what reason ever, be it a refresh
or the user stepping back and resubmitting.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Disable refresh?

2002-12-01 Thread Larry Brown
Thanks guys this forum is going to get me in trouble.  It is so convenient I
keep asking questions too soon.  After submitting the amendment to the
original question I thought of the solution of setting a session variable
and then clearing it before and after the submittal page.  I'll work the
gray matter a little harder next time before asking.  Thanks again.


Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 8:58 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Disable refresh?

> Anyone know of a method of preventing a user from refreshing a page.  I
> get multiple updates with the same information in my database...

Hello!

You can prevent it multiple ways. Two common solution:

 - When creating form, add a unique id to it in a hidden field.
   After succesful insert put that id into a container table,
   what stores used ids. Before inserting, check the presence of
   that id in that container. You can make unique ids with
   php's uniquid() function, or if mod_unique_id compiled into
   Apache, you can use $_SERVER['UNIQUE_ID'] too. Store expire
   dates too with that ids to be able delete old ids with a
   cronjob.

 - Another way: this is easier, but not too elegant. After
   inserting data, send a location header to browser to
   redirect it from that form-processor page to an another.
   After that, refreshing affects that page.

Heilig (Cece) Szabolcs
[EMAIL PROTECTED] - http://phphost.hu




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Disable refresh?

2002-12-01 Thread Martin Towell
no, no way to disable and no variable to say a refresh happened

one way to get around it is to submit to the page that does the update, then
get that page to do a header("location...") to another page. When the user
refreshes, they'll only refresh the last page, and not the updating page.

HTH
Martin

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 12:33 PM
To: PHP List
Subject: RE: [PHP] Disable refresh?


If not, is there a variable that provides information that a refresh
occurred to load the page?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 8:23 PM
To: PHP List
Subject: [PHP] Disable refresh?

Anyone know of a method of preventing a user from refreshing a page.  I get
multiple updates with the same information in my database...

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Disable refresh?

2002-12-01 Thread Larry Brown
If not, is there a variable that provides information that a refresh
occurred to load the page?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 01, 2002 8:23 PM
To: PHP List
Subject: [PHP] Disable refresh?

Anyone know of a method of preventing a user from refreshing a page.  I get
multiple updates with the same information in my database...

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Disable refresh?

2002-12-01 Thread Larry Brown
Anyone know of a method of preventing a user from refreshing a page.  I get
multiple updates with the same information in my database...

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php