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.
apartment cleaning near Highland Park ..We all start out the same. Some have budgets, some... Read More
You have permission to publish this article electronically, in print,... Read More
Q1.Why would I need a web site? A1.- Improve my... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
Your site is fast and getting traffic, but conversion rates... Read More
While most marketers are beginning to understand the critical importance... Read More
1. Choose a big enough font size. A size 12... Read More
Affiliate programs are a great way to earn an income... Read More
As increasing numbers of people search for information on the... Read More
Every small business owner knows that they need a website,... Read More
Your content is what gets you in search engines, speaks... Read More
When web content gets discussed on webmaster bulletin boards, the... Read More
It may seem like the publishing industry's equivalent of Beanie... Read More
If you are developing your website on a host that... Read More
A website lets you put your products in front of... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
When building a relationship, listening is more important than talking.A... Read More
The Internet is being used by local service business to... Read More
The process of Web application development is critical to the... Read More
With search engines putting a damper on direct reciprocal links,... Read More
Many of site owners still don't realize all advantages of... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
The first thing my business consultant (read brother-in-law) asked me,... Read More
Looks like every client wants a Flash site these days... Read More
I talk with so many people who have small businesses... Read More
cleaning lady near Arlington Heights ..What you should do and know if you are an... Read More
Website, website, website, everyone says you need one. But do... Read More
An automated accessibility tool is a piece of software which... Read More
Spend time planning your Web site. Before you design a... Read More
So what do you do if need to get a... Read More
What to put your the website if you are an... Read More
1. Address your targeted audience on your business site. Example:... Read More
If you have some experience in web site design and... Read More
An accessible Web site is easily approached, easily understood, and... Read More
That's right. Your method, behavior and strategy you are now... Read More
There was a time not long ago when setting up... Read More
1. Many people are not getting good or complete advice.... Read More
Many web developers today are starting to KISS their website,... Read More
Design and layout can make your communication come alive and... Read More
If you're fairly new to the Internet scene, you may... Read More
If you are like me you have wanted to build... Read More
When we review the sites of potential clients, there are... Read More
A company must earn and keep trust or sales don't... Read More
Understanding and using web analytics.In recent years, website marketers were... Read More
How do you decide on the content, products and or... Read More
"Don't Sell the Steak, Sell the Sizzle."Have you heard of... Read More
Knowledge is power.And undoubtedly, it is the key to making... Read More
Most people know they need a website in order to... Read More
What to do if you are an artist after you... Read More
A PHP Redirect automatically transfers a web user from one... Read More
Web Development |