|
Posted by Rik Wasmus on 11/06/07 03:44
On Tue, 06 Nov 2007 03:25:41 +0100, ljb <lbayuk@pobox.com.nomail> wrote:
> dave.wayne@gmail.com wrote:
>> On Nov 5, 3:03 pm, foulu0...@gmail.com wrote:
>>> On Nov 5, 5:56 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>>>
>>> > On Mon, 05 Nov 2007 23:37:46 +0100, <foulu0...@gmail.com> wrote:
>>> > > <?php
>>> > > header('Location:http://www.PAGE-TO-REDIRECT-TO.com/');
>>> > > mail('my-em...@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
>>> > > ?>
>>>
>>> > <?php
>>> > mail('my-em...@website.com', 'TEST', $_SERVER['REMOTE_ADDR']);
>>> > header('Location:http://www.PAGE-TO-REDIRECT-TO.com/');
>>> > ?>
>>>
>>> So that would redirect the browser and then send the IP address of the
>>> person accessing the page to an email?
>>
>> that sends an email then redirects the browser.
>> notice the difference?
>
> You got me. What is the difference? Since mail() runs server-side, and
> header sends lines to the browser, I can't see why the order would make
> any
> difference. Both are PHP functions, and both will run regardless of the
> order in the script. Won't they?
On a header redirect, the user effectively 'aborts' as soon as he got it.
Depending on how fast the script runs/the user aborts code may or may not
be run before an untimely end. So, do all your stuff before redirecting,
or instruct PHP to ignore a user abort.
--
Rik Wasmus
[Back to original message]
|