Remember, though, you can't set an HTTP header after you've sent output to the client, 
so you needc to do your redirecting (assuming there's a condition) before you display 
ANYTHING.

BAD:
 <HTML><BODY>
  if (somecondition) { Redirect(www.mypage.com); }
  ...

GOOD:
 <?php 
  if (somecondition) {
    <HTML><BODY>
  } else {
   Redirect(www.mypage.com);
  }

HTH, 

matt

> -----Original Message-----
> From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 30, 2003 10:26 AM
> To: 'Rick Dahl'; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] redirecting to a page
> 
> 
> Redirect(www.mypage.com);
> 
> > -----Original Message-----
> > From: Rick Dahl [mailto:[EMAIL PROTECTED]
> > Sent: Friday, May 30, 2003 10:23 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] redirecting to a page
> > 
> > 
> > I need to redirect to another page once some scripts that I 
> > can't alter run.  
> > 
> > I have this function at the top of my page: 
> > 
> > <?
> >   function Redirect ($url) {
> >      Header ("Location: " . $url);
> >      exit;
> >   }
> > ?>
> > 
> > How do I call the function?
> > 
> > Rick
> > 
> 
> -- 
> 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