RE: Redirecting users

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

 



> If you are running into the header already sent error, try a 
> small javascript redirection...

And you can also use headers_sent() to write a function to do either one
based on whether the headers have been sent already. 

function my_redirect($location) {
   if(headers_sent()) {
      echo ("<script language='javascript'>");
      echo ("document.write(location.href=\"" . $location . "\")"); echo
("</script>");
   } else {
     header($location);
   }
}

$url='http://www.example.com';
my_redirect($url);



PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
     php-objects-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux