Home arrow PHP Tutorials

Translate This Website
Friday, 25 July 2008
Web Development
Request a Quote
Script Categories
RSS Media Grabber Funny Videos & Pictures Life Stories (Flash) Video Search & Download Video Downloader Script Country on Sale Advanced Polls Phone Upload/SMS Scripts PhotoCube Script SlideShow Creation Script Make Confessions Scripts Guitar Tabs Scripts Create Custom Smiley Script Short URLs & Subdomains Hot Or Not Game Scripts Put your text on images Watermark & Image Hosting Joomla Components Low Cost Scripts
Partners
WEBSITE TRAFFIC
Pissed Customers
Credit Cards
Broadband Tweaks & Info
eBay Sniping Software
Custom Programming
Scripts and Stuffs
Hot php scripts
Add your scripts
Script Search
php scripts directory
script heaven
the cgi site
Scripts
Software Development
Free Icons
SEO Services


How To Redirect with PHP Print E-mail
You can use a simple PHP script to redirect a user from the page they entered to a different web page. One reason you may want to do this is that the page they are trying to access no longer exists. Using this method, they can be seamlessly transfered to the new page without having to click a link to continue.


* Users are redirected quickly and seamlessly
* When using the 'Back' button, the user is taken to the last viewed page, not the redirect page
* Works on all browsers



Here's How:

1.

<?php
header( 'Location: http://www.yoursite.com/new_page.html' ) ;
?>

Change the code on the redirect page to be simply this. You need to replace the URL above with the URL you wish to direct to.
2. Be sure that you do not have any text sent to the browser before this, or it will not work. Your safest bet is to simply remove all content from the page but the redirect code.



<html>
<?php
//this will NOT work, the browser received the HTML tag before the script
header( 'Location: http://www.yoursite.com/new_page.html' ) ;
?>

Tips:

1. Remove all code but this
2. Mention on the new page that user's should update their links and bookmarks
3. You can use this code to create a drop down menu that redirects users pages

Credit: http://php.about.com




Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!Free social bookmarking plugins and extensions for Joomla! websites!
 
< Prev
Services
Script Installation
Hosting
Free Image Hosting
PageRank Checker
Login Form
On Sale
Make Confessions Script
Make Confessions Script
$44.95
$34.95
You Save: $10.00
Add to Cart
Home Announcements Support Newsletter Forum PHP Articles PHP Tutorials Scripts FAQs Free Scripts Links Contacts
Copyrighted © 2008 phppod.com