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 ..You have permission to publish this article electronically, in print,... Read More
There is an ongoing debate about web copy. Some say... Read More
First, an eye opener. Making your fortune through affiliate programs... Read More
How can we add Word Rich Content to our Websites... Read More
Recently I was reviewing the keyword specific conversion rate data... Read More
Web templates by nature are created to aid and ease... Read More
Starting and maintaining a business is challenging enough without the... Read More
Failure, just like success, is measured differently by each and... Read More
Why do some sites succeed while the vast majority of... Read More
The first step in setting up an online business...Starting an... Read More
Every small business owner knows that they need a website,... Read More
Fantastico is a 3rd-party cPanel add-on and can be purchased... Read More
With search engines putting a damper on direct reciprocal links,... Read More
Many small businesses have the misconception that their business can... Read More
Everyday thousands of new businesses make the leap and take... Read More
Many small companies choose not to invest in a professionally... Read More
The Internet is a remarkable publishing medium. With just a... Read More
Are you, like many other website owners, frustrated at the... Read More
What is CSS?CSS is a simple file which controls the... Read More
SiteSpinnerSiteSpinner is a user-friendly web site development tool that includes... Read More
If you were asked to put a value on your... Read More
Did you know that hosting companies overcrowd their servers despite... Read More
With all of the factors involved in designing and building... Read More
The definition of the phrase "Content Management" depends on what... Read More
A company must earn and keep trust or sales don't... Read More
pet-friendly home cleaners Mundelein ..To the starting internet entrepreneur, there is nothing more discouraging... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
While it may seem like a "quick and easy" task,... Read More
Launching a new small business website is often a long... Read More
I recently helped my mom to launch a website (www.mom2me.com)... Read More
I talk with so many people who have small businesses... Read More
Design and layout can make your communication come alive and... Read More
Spend time planning your Web site. Before you design a... Read More
There are several reverse bid freelance sites out there. Beyond... Read More
Making maximum profit from your law firm website is important,... Read More
One of the best tools you have as a webmaster... Read More
The internet is a sea of knowledge. Getting your information... Read More
Now that you have got your domain name registered, your... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
Writing for the web is totally different to writing for... Read More
When visitors add your web site to their Favorites or... Read More
The Disability Discrimination Act states that service providers must not... Read More
--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More
From early days of www, the Internet sites that are... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
An additional benefit of website accessibility is an improved performance... Read More
When you consider the billions of individuals and companies on... Read More
We all start out the same. Some have budgets, some... Read More
I had a client say something to me the other... Read More
Dance is how you pamper your soul and satiate your... Read More
Web Development |