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.
premium house cleaning Highland Park ..August 8 2005, Macromedia announced a release of Studio 8.... Read More
"What's in it for me?" you ask. "Why should I... Read More
That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
Profiles are one of the best kept secrets around regarding... Read More
Many small businesses have the misconception that their business can... Read More
Are bloated images slowing down your web site and causing... Read More
If you're anything like most small business owners, you probably... Read More
What is the most important part of your online business?Many... Read More
Many executives and investors are skeptical that software products can... Read More
D.zigns dzignerwebs The Basics Before starting on... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More
If you are looking for creating your online presence you... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
Just like all things in life, the ways to run... Read More
Better Web Site ROIHow to increase your business profitability by... Read More
1) Word of Mouth The single most powerful form of... Read More
It is an undeniable fact that not everybody is keen... Read More
One of the biggest mistakes that most online retailers make... Read More
In the big, wide online world there are millions of... Read More
There are several reverse bid freelance sites out there. Beyond... Read More
An accessible Web site is easily approached, easily understood, and... Read More
Q1.Why would I need a web site? A1.- Improve my... Read More
#5 User Satisfaction: Learn what your visitors and site users... Read More
It never ceases to amaze me how many people set-up... Read More
bedroom cleaning professionals Mundelein ..So you've decided to start an online work at home... Read More
A PHP Redirect automatically transfers a web user from one... Read More
Every business needs to know how it is doing. That's... Read More
There are several reverse bid freelance sites out there. Beyond... Read More
URL rewriting are major needs for your sites that produce... Read More
A common dilemma most small and medium businesses face when... Read More
"'Page Not Found' on this Server. Check the URL and... Read More
After having decided to start a business, the next thing... Read More
1) Word of Mouth The single most powerful form of... Read More
The Disability Discrimination Act states that service providers must not... Read More
Directory Generator, a product from Armand Morin and Marc Quarles,... Read More
What is CSS?CSS is a simple file which controls the... Read More
If you have some experience in web site design and... Read More
Writing for the web is totally different to writing for... Read More
Many of site owners still don't realize all advantages of... Read More
Even with the steady growth of the World Wide Web,... Read More
Simply ensuring your website is accessible to screen reader users... Read More
Knowledge is power.And undoubtedly, it is the key to making... Read More
"I am a writer, not a business-person. I don't want... Read More
From early days of www, the Internet sites that are... Read More
So what do you do if need to get a... Read More
When visitors add your web site to their Favorites or... Read More
Just starting out, you can start with a simple informational... Read More
In this example I have used the map of the... Read More
Although CSS layouts have been around for years, they haven't... Read More
Web Development |