Re: Re: newbie questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 21 October 2007, Richard Heyes wrote:
> Ravi wrote:
> > Richard, unfortunately I cannot end the script. I need something like
> > this:
> >
> > <?php
> >     header('Location: http://www.yahoo.com');
> >     // somehow let the browser move to yahoo.com
> >     // now update the database to store some information about user
> >     exit;
> > ?>
>
> In that case you might want to look at register_shutdown_function().

That would work, but I think you're probably not approaching the question 
properly.  Why do you need to redirect the user first, then log the request?  
PHP/MySQL are fast enough that logging first and then redirecting will have 
no noticeable impact on performance or your user experience.  (I'm assuming a 
logging process here that's only 1-3 queries.)  It sounds like you're trying 
to over-optimize, which is always a bad idea as it makes the code harder to 
understand later. :-)

-- 
Larry Garfield			AIM: LOLG42
larry@xxxxxxxxxxxxxxxx		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux