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.
scheduled cleaning services Winnetka ..So you want to have a website. You have gone... Read More
I recently received an unsolicited e-mail from some company offering... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
With all of the factors involved in designing and building... Read More
Have you ever wondered what challenges are faced by other... Read More
It is an undeniable fact that not everybody is keen... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
"Don't Sell the Steak, Sell the Sizzle."Have you heard of... Read More
Research reveals three important facts:1) The Internet is one of... Read More
If you ever want to create a state directory, article... Read More
It amazes me how many people try to build serious... Read More
Before you jump into spending coutnless hours on designing and... Read More
How many Web Sites did you stumble over telling you... Read More
More and more non-profit organizations are developing websites to help... Read More
--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More
When a user signs up at your website, you may... Read More
Through the explosive growth of the Web, companies have realized... Read More
Many executives and investors are skeptical that software products can... Read More
A while ago one of my clients approached me and... Read More
If you have your own business website and you are... Read More
You have permission to publish this article electronically, in print,... Read More
In the region where my company is located, South Bend,... Read More
1) Word of Mouth The single most powerful form of... Read More
It never ceases to amaze me how many people set-up... Read More
reliable maid service Lincolnshire ..We all start out the same. Some have budgets, some... Read More
QUESTION: Should I build and maintain my business Web... Read More
As a business you can't afford to ignore the Internet... Read More
A system development process can follow a number of standard... Read More
What you should do and know if you are an... Read More
You work hard to build traffic to your web page.... Read More
Does your website have a links/resources page?Do you exchange reciprocal... Read More
1) A marketing necessityI still hear it said from time... Read More
Today it seems everyone is jumping on the entrepreneur bandwagon,... Read More
Everyday thousands of new businesses make the leap and take... Read More
1. Choose a big enough font size. A size 12... Read More
Thousands of people are now making a living online and... Read More
The Internet is a remarkable publishing medium. With just a... Read More
Even though the Internet has been around for a long... Read More
Design and layout can make your communication come alive and... Read More
The first thing you will have to deal building your... Read More
Failure, just like success, is measured differently by each and... Read More
Thinking about starting up a business? The web is the... Read More
When I started my company in 2002, I knew I... Read More
In this day and age most businesses consider having their... Read More
When used to describe a web site, the term "sticky"... Read More
While studying online for IT investment opportunities, I found that... Read More
We've all seen those messages on some websites warning not... Read More
Think up a name and check if yourname.com is available.... Read More
Designing and creating your own website does not have to... Read More
Web Development |