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.
spotless home service Lake Forest ..Making maximum profit from your law firm website is important,... Read More
If you're anything like most small business owners, you probably... Read More
There is an ongoing debate about web copy. Some say... Read More
In 1995 a new era of accessibility for disabled people... Read More
In about the Time it takes to Watch a Reality... Read More
If you have your own business website and you are... Read More
Functions and Subroutines in ASP If you read... Read More
The process of Web application development is critical to the... Read More
Anyone who knows anything about web accessibility knows that images... Read More
Let's begin by setting some limits. If you're like me,... Read More
If one more business owner tells me their website sucks... Read More
If you've been developing websites on Mars for the past... Read More
Often time I've browsed sites and seen the same thing... Read More
Do you need a web site? Are you considering getting... Read More
Have you ever wondered what challenges are faced by other... Read More
One of the things that many people overlook when building... Read More
When web content gets discussed on webmaster bulletin boards, the... Read More
Many millions of dollars are being wasted on promoting and... Read More
When most people build a web site, they think one... Read More
To the starting internet entrepreneur, there is nothing more discouraging... Read More
A website is the most versatile and cost-effective marketing tool... Read More
When you started reading this sentence you assumed lo acabar?a... Read More
There are millions and millions of websites on the Internet.... Read More
Whether you have your own business already, or are looking... Read More
In the region where my company is located, South Bend,... Read More
weekly home cleaning Mundelein ..Q. Hey, Cathy: I'm just setting up a website. What... Read More
So you've decided to start an online work at home... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
1. Address your targeted audience on your business site. Example:... Read More
1. SiteSpinner V2 - On Sale www.deprice.com/sitespinner.htmSiteSpinner is a user-friendly... Read More
Spend time planning your Web site. Before you design a... Read More
There are many elements that are key to successful web... Read More
The evolution of web development parallels the model of technology... Read More
Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More
Making money with your web site is the dream and... Read More
Build it and they will come is not always true;... Read More
The first step in setting up an online business...Starting an... Read More
This article was prompted by some customer support work I... Read More
While studying online for IT investment opportunities, I found that... Read More
Project Safekids provides webmasters a valuable tool which could save... Read More
Building a website and getting it online is easy. Driving... Read More
If you haven't made the sales and built your clients... Read More
A common dilemma most small and medium businesses face when... Read More
Rosalind wants to share her inspirational poetry with a wider... Read More
An Introduction to Server Side IncludesBeginner? That's OK!While much has... Read More
Starting and maintaining a business is challenging enough without the... Read More
There is an ongoing debate about web copy. Some say... Read More
If you are looking for creating your online presence you... Read More
"How do I improve web site sales figures?" The CEO... Read More
A professional online reputation is essential to the flourishing of... Read More
Web Development |