RE: [PHP] Credit card debiting and preventing the user from aborting
| From: | James Moore | Date: | Wed, 23 Aug 2000 09:41:42 +0000 |
| Subject: | RE: [PHP] Credit card debiting and preventing the user from aborting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13121@lists.php.net to get a copy of this message | ||
> 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..