|
|
|
|
![]() ![]() |
Apr 9 2007, 10:03 AM
Post
#1
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 144 Joined: 22-March 07 Member No.: 40,472 |
[PHP] Header function
Greetings we are going to use the header() funtion to redirect start making a file called page.php at the top of the file add CODE <?php ?> Example 1 After <?php add CODE header('Location: http://www.trap17.com'); the LOCATION means where you want it to go. Example 2 you also can define a file that you want to redirect to After <?php add CODE header('Location: index.php'); Example 3 you also can add a timer to it After <?php add CODE header('Refresh: 0; url=http://www.trap17.com' ); Refresh: 0; means that it will refresh to the url you entered and the 0; means the seconds it wait to refresh. Example 4 now if you want to go to the root of the site use this After <?php add CODE header('Refresh: 3; url=/'); Have fun with this tutorial.. This post has been edited by Blessed: Apr 9 2007, 10:04 AM |
|
|
|
Apr 9 2007, 01:09 PM
Post
#2
|
|
|
A clever man learns from his own mistakes, a WISE man learns from those of OTHERS ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 1,028 Joined: 12-April 06 From: Essex, UK Member No.: 21,719 |
Hey, nice bit of info there, i never knew you could add a timer to the redirect thingy, that could be very useful.
Its worth mentioning that any HEADER function wont work if there is output before it. Eg if you used ECHO or PRINT before using the HEADER it will give an error, i think you can d ther things like form processing, database connections etc but nothing can be output to the browser before the HEADER, that caused me some headaches in the past. |
|
|
|
Apr 9 2007, 02:10 PM
Post
#3
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 144 Joined: 22-March 07 Member No.: 40,472 |
thanx shadowx for givven that last info for me
thanx for the support |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 12th October 2008 - 03:37 PM |