Webmaster Tutorials - Web Development
Webmaster Resource Directory | Contact Us | Submit Your Site

LEARN

BUILD

PROMOTE

SELL

MANAGE

GET LISTED



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 Web Development Articles

Achieving Differentiation With Your Website
Internet Marketing is not a miracle marketing strategy ? competition still exists and you need to have a unique approach with regards to:Web Design Just as in the ?real world?, where your brand needs to have a unique look and feel about it, so does your website. You won?t have much luck finding a web design template that is consistent with your corporate identity.

Art, Artists and the Web: Part 4--What to Do After a Website is Designed
What to do if you are an artist after you finish your website.Unfortunately, just because you?ve created a website, does not mean that anyone will visit it.

Art, Artists and the Web: Part 3--What to Put on an Artist?s Website
What to put your the website if you are an artist.1) The art workTry and think like a gallery hanging a show.

Art, Artists, and the Web:Part: 2--First Steps in Building an Artist?s Website
What you should do and know if you are an artist and you have decided to have a website.1) Look at "Web Sites That Suck.

Improve Conversion Rates ? Load Times
Your site is getting traffic, but conversion rates are horrible. Everything seems to be working, so what?s wrong? Your site may simply be to slow.

Improve Conversion Rates ? Effective Content
Your site is fast and getting traffic, but conversion rates are disappointing. You may have problems with the tone of your contentDo You Believe?You must have passion for the product or service you are providing.

Make Your Communication Come Alive
Design and layout can make your communication come alive and your message immediately apparent. Now, with so much technology at hand, design becomes much easier, but you must develop the ability to plan and visualize what you want to convey.

The Dos and Donts of Launching a Small Business Website
Launching a new small business website is often a long and painstaking process. And for most small businesses, the endeavor rarely ends in success.

Website Success is Key
The popular search engine Google indexes over 8 billion websites. Is one of them yours, or is your website just floating around in cyberspace and you?re hoping your customers will just find you? Is your website a benefit to your organization or company? Is it just an expensive showpiece or is it of true value?These are some of the many questions that can be asked when launching a new website.

Tips for Building a Great Business Website
A website is lifeline of internet home business. In order to succeed you must have a website that that meets the general criteria of accepted standards.




Helpful Tools

NetDownload
freeware and software downloads

Findahost
web hosting directory

FindaTechJob
new computer jobs daily

ManagedHostingPro
Managed Hosting and Colocation



© 2007 webmasteredge.com