RE: [PHP] Credit card debiting and preventing the user from aborting
| From: | Stefen Lars | Date: | Wed, 23 Aug 2000 09:55:49 +0000 |
| Subject: | RE: [PHP] Credit card debiting and preventing the user from aborting | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-13126@lists.php.net to get a copy of this message | ||
I think a combination of what Bruin suggested and what you are suggesting (should it work :-)) ) is a very good idea.
I shall get to work.
S.
From: "James Moore" <James@phpuk.org>
To: "Stefen Lars" <stefenlars@hotmail.com>
CC: <php-general@lists.php.net>
Subject: RE: [PHP] Credit card debiting and preventing the user from aborting
Date: Wed, 23 Aug 2000 10:41:42 +0100
I were to register ignore_user_abort and the user were to abort,
would does
this mean that nothing would be displayed in the browser when the
script has
come to its' logical end?
This is indeed the case
I still have the problem that money has been debited from the customer's
card, but he/she does not know about it, as nothing has been displayed in
this/her browser. Hence, he/she could (maybe) try again and debit his/her
card again.
Am I missing something here?
As far as I know when a browser stops a connection it will not accept any
further input, one option would be to use javascript. In the body tag do
somthing along the lines of
*Persudo Javascript*
onUnload="mymsgbox() onLoad="setflag()"
Then just before the body you set up the following:
<script lang=javascript>
int flag = 0;
function mymsgbox() {
if(flag == 0) {
ALERT("ARGGGHH YOU SILLY FOOL DONT PRESS STOP....");
}
}
function onLoad() {
flag = 1;
}
</script>
Not promising it will work but it might.
Another option (That I have never tried and have no idea if it would work)
would be to register ignore_user_abort() and then send them off to a quick
loading page with header() this has lots of dis advantages though as errors
will not be shown.. Perhaps you should look at implementing a status bar if
it takes so long.... Or just make it very clear to the user the they cannot
cancel the transaction..
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com