944,138 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1981
  • PHP RSS
Apr 28th, 2006
0

URL Redirection in PHP

Expand Post »
Is there any other function in PHP that can be used for redirecting a page

I use the following

PHP Syntax (Toggle Plain Text)
  1. header ("location: index.php");


But it generates the following error:

PHP Syntax (Toggle Plain Text)
  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?
Similar Threads
Reputation Points: 58
Solved Threads: 1
Posting Whiz in Training
cancer10 is offline Offline
234 posts
since Dec 2004
Apr 28th, 2006
0

Re: URL Redirection in PHP

Actually this is my code

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


I get the error

PHP Syntax (Toggle Plain Text)
  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
Reputation Points: 58
Solved Threads: 1
Posting Whiz in Training
cancer10 is offline Offline
234 posts
since Dec 2004
Apr 29th, 2006
0

Re: URL Redirection in PHP

Well i use header function and it works good
Reputation Points: 10
Solved Threads: 0
Newbie Poster
smartsoft is offline Offline
5 posts
since Apr 2006
Apr 30th, 2006
0

Re: URL Redirection in PHP

Try:
PHP Syntax (Toggle Plain Text)
  1. <?
  2. session_start();
  3. header("Location: tussu.php"); //or (*)
  4. echo "Logging out ".$_SESSION['userid'];
  5. ?>
(*)
PHP Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sepedatua is offline Offline
2 posts
since Apr 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Secure MP3 Downloads ?? Help Needed
Next Thread in PHP Forum Timeline: Help with jump.php Script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC