RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1448 | Replies: 3 | Thread Tools  Display Modes
Reply
Join Date: Dec 2004
Location: India
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Help URL Redirection in PHP

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

I use the following

header ("location: index.php");


But it generates the following error:

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?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: India
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Re: URL Redirection in PHP

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

<?
session_start();

echo "Logging out ".$_SESSION['userid'];

header("location: tussu.php");

?>


I get the error

Logging out admin
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  
Join Date: Apr 2006
Location: Nigeria/Lagos
Posts: 5
Reputation: smartsoft is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
smartsoft smartsoft is offline Offline
Newbie Poster

Re: URL Redirection in PHP

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

Re: URL Redirection in PHP

  #4  
Apr 30th, 2006
Try:
<?
session_start();
header("Location: tussu.php"); //or (*)
echo "Logging out ".$_SESSION['userid'];
?>
(*)
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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:27 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC