URL Redirection in PHP

Reply

Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

URL Redirection in PHP

 
0
  #1
Apr 28th, 2006
Is there any other function in PHP that can be used for redirecting a page

I use the following

  1. header ("location: index.php");


But it generates the following error:

  1. Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\program files\easyphp1-8\www\admin-right-nav.php:5) in c:\program files\easyphp1-8\www\admin-right-nav.php on line 6


Is there any alternative in php?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Re: URL Redirection in PHP

 
0
  #2
Apr 28th, 2006
Actually this is my code

  1. <?
  2. session_start();
  3.  
  4. echo "Logging out ".$_SESSION['userid'];
  5.  
  6. header("location: tussu.php");
  7.  
  8. ?>


I get the error

  1. Logging out admin
  2. Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\logout.php:3) in c:\program files\easyphp1-8\www\logout.php on line 6
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5
Reputation: smartsoft is an unknown quantity at this point 
Solved Threads: 0
smartsoft smartsoft is offline Offline
Newbie Poster

Re: URL Redirection in PHP

 
0
  #3
Apr 29th, 2006
Well i use header function and it works good
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 2
Reputation: sepedatua is an unknown quantity at this point 
Solved Threads: 0
sepedatua sepedatua is offline Offline
Newbie Poster

Re: URL Redirection in PHP

 
0
  #4
Apr 30th, 2006
Try:
  1. <?
  2. session_start();
  3. header("Location: tussu.php"); //or (*)
  4. echo "Logging out ".$_SESSION['userid'];
  5. ?>
(*)
  1. header("Refresh: 5; URL:http://www.domain.com/path/to/tussu.php");
5 <= this will show your "Logging out ".$_SESSION['userid']" for 5 seconds.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC