User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 401,719 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,143 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1257 | Replies: 3
Reply
Join Date: Dec 2004
Location: India
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Rep Power: 4
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: 4
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.

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

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:01 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC