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.
top rated cleaning service Lake Forest ..You know exactly what your organisation does and what your... Read More
Psychology is a long word which everyone thinks, "no, that's... Read More
The evolution of web development parallels the model of technology... Read More
There are millions and millions of websites on the Internet.... Read More
Q1.Why would I need a web site? A1.- Improve my... Read More
The first thing you will have to deal building your... Read More
Building a new website can be a lengthy task. From... Read More
Many small companies choose not to invest in a professionally... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
If you haven't made the sales and built your clients... Read More
I recently received an unsolicited e-mail from some company offering... Read More
Think up a name and check if yourname.com is available.... Read More
I had a client say something to me the other... Read More
Failure, just like success, is measured differently by each and... Read More
They might not be wearing a mask and carrying a... Read More
Today it seems everyone is jumping on the entrepreneur bandwagon,... Read More
That's right. Your method, behavior and strategy you are now... Read More
If you don't have a web site yet, are thinking... Read More
Visitors to your site come looking for information or solutions... Read More
Affiliate programs are a great way to earn an income... Read More
The art of turning website visitors into paying customers depends... Read More
One of the best tools you have as a webmaster... Read More
So you want to have a website. You have gone... Read More
Most people know they need a website in order to... Read More
Wow, we`ve already taken a domain and chosen a web... Read More
insured cleaning company Morton Grove ..From early days of www, the Internet sites that are... Read More
To the starting internet entrepreneur, there is nothing more discouraging... Read More
"I am a writer, not a business-person. I don't want... Read More
QUESTION: Should I build and maintain my business Web... Read More
Revenues are often lost because many business owners don't see... Read More
Every small business owner knows that they need a website,... Read More
When you take a look at the most visited sites... Read More
What is web accessibility & why is it important?Web accessibility... Read More
Better Web Site ROIHow to increase your business profitability by... Read More
Through the explosive growth of the Web, companies have realized... Read More
While most marketers are beginning to understand the critical importance... Read More
This article was prompted by some customer support work I... Read More
Website, website, website, everyone says you need one. But do... Read More
In the big, wide online world there are millions of... Read More
The following is a list of patterns that many visitors... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
Your site is getting traffic, but conversion rates are horrible.... Read More
There are many elements that are key to successful web... Read More
When you purchase a new item from a Yahoo! Store,... Read More
Everywhere you look these days, people are telling you that... Read More
Starting a business online is no longer as difficult as... Read More
People like to get immediate responses to requests. Autoresponders are... Read More
First, an eye opener. Making your fortune through affiliate programs... Read More
With all of the factors involved in designing and building... Read More
Anyone who knows anything about web accessibility knows that images... Read More
Web Development |