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.
Beecher limo rentals ..That's right. Your method, behavior and strategy you are now... Read More
A website is lifeline of internet home business. In order... Read More
Optimize your time. How much time each day must you... Read More
A lot has changed in the way sites are optimized... Read More
Let's begin by setting some limits. If you're like me,... Read More
Design and layout can make your communication come alive and... Read More
Before you jump into spending coutnless hours on designing and... Read More
Although there are significant differences among the various types of... Read More
The following is a list of patterns that many visitors... Read More
When marketing your website, it's important to know which of... Read More
1. SiteSpinner V2 - On Sale www.deprice.com/sitespinner.htmSiteSpinner is a user-friendly... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
What you should do and know if you are an... Read More
RIVERSIDE, CA August 4, 2004 ?- "Historically, small business owners... Read More
How do you decide on the content, products and or... Read More
One of the things that many people overlook when building... Read More
A website is the most versatile and cost-effective marketing tool... Read More
A system development process can follow a number of standard... Read More
So you want to take a look at a real... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
I can't think of any business alive today that couldn't... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
The big thing these days is your ability to capture... Read More
We all start out the same. Some have budgets, some... Read More
Bridgeview limo Chicago ..Designing and creating your own website does not have to... Read More
Getting a Targeted Visitor to a website is a waste... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
What to do if you are an artist after you... Read More
Many web developers today are starting to KISS their website,... Read More
An additional benefit of website accessibility is an improved performance... Read More
After years of working with entrepreneurs who developed their first... Read More
Thinking about starting up a business? The web is the... Read More
Creating a content management system either from scratch,... Read More
Functions and Subroutines in ASP If you read... Read More
Creating and maintaining an effective presence on the Web has... Read More
To the starting internet entrepreneur, there is nothing more discouraging... Read More
Writing for the web is totally different to writing for... Read More
Web sites are not just places to sell things; they... Read More
Fantastico is a 3rd-party cPanel add-on and can be purchased... Read More
You work hard to build traffic to your web page.... Read More
A website is lifeline of internet home business. In order... Read More
If you are developing your website on a host that... Read More
How can we add Word Rich Content to our Websites... Read More
So your prospect, Mary, is sitting at the computer reading... Read More
The needs of screen magnifier users are overlooked when implementing... Read More
One of my most salient memories from when I sold... Read More
Every online entrepreneur I talk to is asking the same... Read More
Does your website have a links/resources page?Do you exchange reciprocal... Read More
Selecting the Perfect Domain NameThe first issue I have with... Read More
Web Development |