Web Development Information

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:

Web Design Company in UK Offers Outsourced Web Development and ...
The Open Press (press release) - May 10, 2008
(OPENPRESS) May 9, 2008 -- Kronik Media, the London based web design company are known for the value of their web development services for businesses. ...


Leading Web Development Firm Rockfish Interactive Selects Internap ...
FOXBusiness - May 6, 2008
"Rockfish Interactive's impressive customer base reflects the firm's great achievements in the Web-development space," said Tim Sullivan, chief technology ...


Arrival of technologically advanced web development company ‘Spinx'
PR-Inside.com (Pressemitteilung), Austria - May 5, 2008
2008-05-05 09:28:57 - Based in Los Angeles, Spinx provides professional website design and web development services to clients in the LA area, Orange County ...


New tool could make web development simpler
BizReport - May 5, 2008
If you've checked in with other web development companies, you know this is quite a bit quicker than other options. Here is how it works: developers begin ...


CodeGear offers drag-and-drop web development
ZDNet UK, UK - Apr 15, 2008
... PHP debugging options sit alongside error insight and source-code formatting features to reduce the potential for bug creation in web development. ...


Intuit Web development software launches in beta
Bizjournals.com, NC - Apr 17, 2008
Mountain View-based Intuit (NASDAQ:INTU) said QuickBase is designed to let developers and independent software vendors "easily design, deploy and market ...


Web Development Firm
Black Hills Today, SD - May 1, 2008
The web developers at this South Dakota firm are on the cutting-edge of innovative web development strategy, they have created and launched successful ...


Friendlier source code with two Firefox add-ons
TechRepublic, KY - 11 hours ago
One of the more frustrating aspects of Web development is debugging. The disconnected nature of a Web page makes it hard to always see what is happening ...


The Navigation Aspect of Web Development
Promotion World (press release), CA - Apr 24, 2008
Navigation thus, is an important aspect of web development. A well navigated website, makes surfing an enriching experience and also enables a proper ...


Google Wants to Facebook Friend You
TIME - 6 hours ago
Only five months in, 2008 is shaping up to be a pivotal year in the Web's development. I can't wait to see what happens next.

Web-Development - Google News

home | site map
© 2006 Webhosting-Service.com - All Rights reserved. - GetWeb Media Webdesign Muenchen