Home | Site Map           
   
     

PHP Redirect


A PHP Redirect automatically transfers a web user from one URL to another. For example, typing foo.com in the browser automatically transfers the user to another URL bar.com.

The PHP Redirect command:

Replace [some-url] with the URL where you want the redirection to take place.

For example,

header("location: ./version2/index.html"); =>redirect to "index.html" page in subfolder called "version2"

header("location: http://www.yahoo.com"); =>redirect to a website called yahoo.com

If PHP is not available, it's also possible to use other redirects:

* HTTP Redirects

Replace [time] with seconds. This will pause the browser for the specified number of seconds. Replace [some-url] with the target URL you want to redirect.

For example,

The above HTTP based redirect needs to be in the region of the HTML code.

* JavaScript Redirects

setTimeout("location.href='[some-url]'", [time]);

Replace [time] with milliseconds. This will pause the browser for the specified number of seconds. Replace [some-url] with the target URL you want to redirect.

For example, setTimeout("location.href='http://www.yahoo.com'", 5000);

The above JavaScript based redirect can be either in the or region of the HTML code.

Usually a PHP redirect is much more reliable than other form of redirects like HTTP redirect or JavaScript based redirects. For example a JavaScript redirect may not work if a user's browser settings has JavaScript turned off.

The reason why PHP redirects will work no matter what settings users have on their browser is because PHP is server side script. It will not depend on browser settings that may affect JavaScript which is parsed on the client-side/user-side.

About the Author
Sanjib Ahmad, Freelance Writer and Product Consultant for http://www.marc8.com.

You are free to use this article in its entirety as long as you leave all links in place, do not modify the content, and include the resource box listed above.


MORE RESOURCES:

Yahoo! News Search Results for website design
Yahoo! News Search Results for website design

StockLayouts Offers Subscriptions to Its Entire Design Template Library and R...
StockLayouts LLC , the leading provider of graphic design templates for print, has introduced subscriptions as the principal way for its customers to purchase and download a constant supply of its fully designed templates for creating business marketing materials.
A Luna Blue Launches New Website. (Broadcast Newsroom)
Stock Footage Website Launched By A Luna Blue. DMN Newswire--2008-8-26--A Luna Blue stock footage launches a new website design. They're still tarting up nature, chasing moonlight and spinning the globe now with every stock video clip available in HD, DV and Multimedia formats.
Reed Business Information's Design News (www.designnews.com) Announces Mechat...
WALTHAM, Mass., Aug. 27 -- Design News (www.designnews.com) along with sister publications, Control Engineering, EDN and Test & Measurement World, have announced Mechatronics 2.0: Driving Innovation in the Auto Industry, an expo and conference on September 9th in Dearborn, Michigan at the Ford Motor Co. Event and Conference Center.
Stracka Design Company Acquires GolfQ.com to Expand Golf Course Promotion Bus...
The Stracka Design Company LLC, home of www.Stracka.com, Golf's premier social network, has acquired the assets of Texas-based GolfQ.com Inc. GolfQ (www.GolfQ.com) touts itself as being the World's Largest Golf Community and has been helping golf courses promote their property since 1999.
The Continental Group Launches Internet Marketing with New Website to help Co...
ELEMENTS, an internet marketing agency, Launches The Continental Group on ElementsConnect? for website management. The primary objective of the new website was enhancement of brand messaging, interactivity and design. ELEMENTS provides real value through a combination of beautiful designs, great customer service and innovative technology solutions. (PRWeb Aug 26, 2008) Read the full story at ...

 

 

Food     PeoplesChoice | Web Starter | PhotoLog | Workstations | Web Design | Photo Blog | Articles Searches | Daily Blog     MP3

Copyright © 2008 All Rights Reserved TheWebStylist.com