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.
cleaning service near Bannockburn ..The internet is a sea of knowledge. Getting your information... Read More
In about the Time it takes to Watch a Reality... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
Alternate medicine finds its own place in the hearts and... Read More
Building a new website can be a lengthy task. From... Read More
Huge Mistake #1: Creating a Website with Flash -- Did... Read More
Although CSS layouts have been around for years, they haven't... Read More
When used to describe a web site, the term "sticky"... Read More
Build it and they will come is not always true;... Read More
It may come as some surprise to a traditionally off-line... Read More
You know exactly what your organisation does and what your... Read More
So you want to take a look at a real... Read More
In this example I have used the map of the... Read More
Functions and Subroutines in ASP If you read... Read More
Directory Generator, a product from Armand Morin and Marc Quarles,... Read More
Often time I've browsed sites and seen the same thing... Read More
Today it seems everyone is jumping on the entrepreneur bandwagon,... Read More
Through the explosive growth of the Web, companies have realized... Read More
A lot has changed in the way sites are optimized... Read More
Webmasters deal with a myriad of complex design challenges every... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
From early days of www, the Internet sites that are... Read More
If you were asked to put a value on your... Read More
When building a relationship, listening is more important than talking.A... Read More
If you've been developing websites on Mars for the past... Read More
pet-friendly home cleaners Mundelein ..I still remember it very clear ... It was almost... Read More
Your website conversion rate should concern you. This simply refers... Read More
Part of the success of most home-based businesses is their... Read More
Every business needs to know how it is doing. That's... Read More
The evolution of web development parallels the model of technology... Read More
A website is lifeline of internet home business. In order... Read More
It may seem like the publishing industry's equivalent of Beanie... Read More
So you have a good idea for a business and... Read More
See how you can create graphic effects on text with... Read More
I am just a learner who likes to delve in... Read More
Installment 1Developing State-enabled Applications With PHPWhen a user is browsing... Read More
I'm one of those people that always wanted a website,... Read More
Internet has opened a whole new world for web developers... Read More
Developing a website with content that entices visitors to return... Read More
"If you build it, they will come"; is an age... Read More
If you have some experience in web site design and... Read More
Design and layout can make your communication come alive and... Read More
After planning the design and content of your website, it's... Read More
It's now easier than ever to take payments on the... Read More
Making money with your web site is the dream and... Read More
A common dilemma most small and medium businesses face when... Read More
Q. Hey, Cathy: I'm just setting up a website. What... Read More
We all start out the same. Some have budgets, some... Read More
Appealing to others is really important when you have a... Read More
Better Web Site ROIHow to increase your business profitability by... Read More
Web Development |