pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedUser reloads inert script...
3+ messages / 3 participants
[nested] [flat]
* User reloads inert script...
@ 2001-05-10 00:20 Christian Marschalek <cm@chello.at>
0 siblings, 1 reply; 3+ messages in thread
From: Christian Marschalek @ 2001-05-10 00:20 UTC (permalink / raw)
To: pgsql-php
Hey there:)
What would you do?
Situation: you have a script doing some HTML formular data processing,
some selects and inserts in a transaction and some html output.
When the script is cancled on the client side. By normal PHP will cancel
the script it self (which can be prevented). Now hopefully the
transaction will be rolled back on PostgreSQLs side. Everything fine...
But what If the user reloads the page? Then the whole process will be
done twice... How would you prevent that?
Tia! Chris
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: User reloads inert script...
@ 2001-05-14 00:35 Grant <grant@conprojan.com.au>
parent: Christian Marschalek <cm@chello.at>
0 siblings, 0 replies; 3+ messages in thread
From: Grant @ 2001-05-14 00:35 UTC (permalink / raw)
To: pgsql-php
Well hopefully the error can easily be seen if it's a duplicate entry in
a table or something along those lines, and your IE will prompt you
before reposting form data. However, you can set a session variable that
identifies that the "process" you are performing has already been
completed. So after the insert is complete it will set the session
variable as 1, then if they press repost the variable exists and the
data will not be inserted again, and when the user clicks on the correct
menu to prompt to insert "new" data into the database, the variable will
be unset, so the insert can pass through, and then set again to stop
futher duplicate posts of the same data. Hope this helps.
On Thu, 10 May 2001, Christian Marschalek wrote:
> Hey there:)
>
> What would you do?
>
> Situation: you have a script doing some HTML formular data processing,
> some selects and inserts in a transaction and some html output.
>
> When the script is cancled on the client side. By normal PHP will cancel
> the script it self (which can be prevented). Now hopefully the
> transaction will be rolled back on PostgreSQLs side. Everything fine...
>
> But what If the user reloads the page? Then the whole process will be
> done twice... How would you prevent that?
>
> Tia! Chris
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* RE: User reloads inert script...
@ 2001-05-14 07:05 Maxim Maletsky <maxim@japaninc.com>
0 siblings, 0 replies; 3+ messages in thread
From: Maxim Maletsky @ 2001-05-14 07:05 UTC (permalink / raw)
To: 'Grant' <grant@conprojan.com.au>; pgsql-php
Netscape does it alllll the time.
For Example: user's filling in the form, then tries to resize it's browser
window to get a better visibility, Netscape will reload.
The best way to prevent this is by having a unique values, and before
inserting checking for duplicates. The worth way to fix it is by having more
then one form and/or some session variables as was advised before.\
Cheers,
Maxim Maletsky
-----Original Message-----
From: Grant [mailto:grant@conprojan.com.au]
Sent: Monday, May 14, 2001 9:35 AM
To: pgsql-php@postgresql.org
Subject: Re: [PHP] User reloads inert script...
Well hopefully the error can easily be seen if it's a duplicate entry in
a table or something along those lines, and your IE will prompt you
before reposting form data. However, you can set a session variable that
identifies that the "process" you are performing has already been
completed. So after the insert is complete it will set the session
variable as 1, then if they press repost the variable exists and the
data will not be inserted again, and when the user clicks on the correct
menu to prompt to insert "new" data into the database, the variable will
be unset, so the insert can pass through, and then set again to stop
futher duplicate posts of the same data. Hope this helps.
On Thu, 10 May 2001, Christian Marschalek wrote:
> Hey there:)
>
> What would you do?
>
> Situation: you have a script doing some HTML formular data processing,
> some selects and inserts in a transaction and some html output.
>
> When the script is cancled on the client side. By normal PHP will cancel
> the script it self (which can be prevented). Now hopefully the
> transaction will be rolled back on PostgreSQLs side. Everything fine...
>
> But what If the user reloads the page? Then the whole process will be
> done twice... How would you prevent that?
>
> Tia! Chris
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-05-14 07:05 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-10 00:20 User reloads inert script... Christian Marschalek <cm@chello.at>
2001-05-14 00:35 ` Grant <grant@conprojan.com.au>
2001-05-14 07:05 RE: User reloads inert script... Maxim Maletsky <maxim@japaninc.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox