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.
executive chauffeured services Bradford .. Madison to Airport carIt's now easier than ever to take payments on the... Read More
This simple question can take on several different forms, but... Read More
So what do you do if need to get a... Read More
Although CSS layouts have been around for years, they haven't... Read More
I've heard several prominent web marketers mention in their classes... Read More
A while ago one of my clients approached me and... Read More
August 8 2005, Macromedia announced a release of Studio 8.... Read More
If you haven't made the sales and built your clients... Read More
After having decided to start a business, the next thing... Read More
Why do some web sites reap huge benefits while others... Read More
Every online entrepreneur I talk to is asking the same... Read More
So your traffic is going through the roof yeah? It's... Read More
Psychology is a long word which everyone thinks, "no, that's... Read More
First, an eye opener. Making your fortune through affiliate programs... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
QUESTION: Should I build and maintain my business Web... Read More
Your business website is a critical aspect of being able... Read More
Web sites are not just places to sell things; they... Read More
With all of the factors involved in designing and building... Read More
Installment 1Developing State-enabled Applications With PHPWhen a user is browsing... Read More
1. As the first step, "Hire a web designer."First create... Read More
When most people build a web site, they think one... Read More
Making a web site is easy. Making a good web... Read More
When you started reading this sentence you assumed lo acabar?a... Read More
In 1995 a new era of accessibility for disabled people... Read More
O'Hare Chicago prom limo ..We are clearly well past the innocent "golden age" of... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
Three way linking and concerns.For many years SEO experts were... Read More
Let's begin by setting some limits. If you're like me,... Read More
August 8 2005, Macromedia announced a release of Studio 8.... Read More
Even with the steady growth of the World Wide Web,... Read More
If you've been developing websites on Mars for the past... Read More
Build it and they will come is not always true;... Read More
Many web developers today are starting to KISS their website,... Read More
Before you jump into spending coutnless hours on designing and... Read More
When marketing your website, it's important to know which of... Read More
Many small companies choose not to invest in a professionally... Read More
The first step in setting up an online business...Starting an... Read More
One of the most important parts of establishing a new... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
We've all seen those messages on some websites warning not... Read More
From early days of www, the Internet sites that are... Read More
Your website conversion rate should concern you. This simply refers... Read More
2 Golden Rules for an Engaging Website35% of visitors fail... Read More
An accessible Web site is easily approached, easily understood, and... Read More
Having an eye catching website is great, but are you... Read More
Website, website, website, everyone says you need one. But do... Read More
Making a web site is easy. Making a good web... Read More
A lot has changed in the way sites are optimized... Read More
The Disability Discrimination Act says that websites must be made... Read More
Web Development |