Not to mention, the header() statement is being used incorrectly in the
example code.

You don't echo out the header() statement. You simply use it.

For example...

<?php
        include("whateveryouwant.inc");//as long as the .inc does not output
to browser
        ...BUNCHA' PHP STUFF, BUT NO ECHO STATEMENTS...
        header("Location:www.example.com");
?>

In your sample code, you include("mainmenu.php") which looks like it would
output to the browser. You can't to that on the same page you use header().

HTH,
Rich


> -----Original Message-----
> From: Brent Baisley [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 12, 2004 4:12 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] How to redirect after a valid login 
> 
> 
> You can do a redirect at any point in your code as long as 
> you haven't  
> sent anything to the browser yet. You can run 10,000 lines of 
> PHP code  
> and do 1,000 queries and still send a redirect to the 
> browser. In a nut  
> shell, have no echo statement before your redirect.
> 
> 
> On Mar 12, 2004, at 3:02 PM, Larry Sandwick wrote:
> 
> > Is there a way that after a execution of a Login script and 
> validation
> > of login from a MySql database to automatically redirected to run
> > another script ?
> >
> >
> > example
> >
> > someone logs in through the login.php script, in the login 
> script you
> > are validated and then you run another script called mainmenu.php ?
> >
> >
> >
> >
> >
> > I have tried the following:
> >
> >
> >
> > include "mainmenu.php"; // Which gives me an error !
> >
> >
> >
> > This one just put the link on the page and does not 
> redirect to another
> > script.
> >
> > echo "header(Location: <a
> > href=http://www.example.com/InVocie/MainMenu.php);
> > '
> > 
> target='_blank'>http://www.example.com/InVoice/MainMenu.php?r=$a);</ 
> > a>";
> > /* Redirect browser */
> >
> >
> >
> >
> >
> >
> > Larry Sandwick
> >
> > Sarreid, Ltd.
> >
> > Network/System Administrator
> >
> > phone: (252) 291-1414 x223
> >
> > fax      : (252) 237-1592
> >
> >
> >
> >
> -- 
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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

Reply via email to