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.
top rated cleaning service Lake Forest ..Setting up a website is the very first step of... Read More
Recently, a friend asked "What's the deal with those DIY... Read More
Website, website, website, everyone says you need one. But do... Read More
Customer service questionnaires can help your clients better understand their... Read More
Server Side Includes (SSI) with ASP People often... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
Most interactive websites nowadays would require a user to log... Read More
The internet has taken over our lives with a vengeance,... Read More
Part of the success of most home-based businesses is their... Read More
If you have some experience in web site design and... Read More
So you want to take a look at a real... Read More
Build it and they will come is not always true;... Read More
With all of the factors involved in designing and building... Read More
1. Splash pagesMost of the time splash pages are uncalled... Read More
1. Be clear on your purpose.Building a website can be... Read More
Many web developers today are starting to KISS their website,... Read More
How many Web Sites did you stumble over telling you... Read More
When visitors add your web site to their Favorites or... Read More
Designing an E-commerce Web site is not as simple as... Read More
It amazes me how many people try to build serious... Read More
The Internet is a remarkable publishing medium. With just a... Read More
When you started reading this sentence you assumed lo acabar?a... Read More
Understanding and using web analytics.In recent years, website marketers were... Read More
A website is like an information flow, with you as... Read More
Your business website is a critical aspect of being able... Read More
insured cleaning company Morton Grove .."I have a small business with just a couple of... Read More
Many websites I come across don't have a single link... Read More
Alternate medicine finds its own place in the hearts and... Read More
The DDA (Disability Discrimination Act) states that service providers must... Read More
Dance is how you pamper your soul and satiate your... Read More
The growth in Internet usage around the world is astounding... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More
When a user signs up at your website, you may... Read More
Now that you have got your domain name registered, your... Read More
1. Address your targeted audience on your business site. Example:... Read More
Many small businesses have the misconception that their business can... Read More
So you want to have a website. You have gone... Read More
Web sites are an Ongoing Part of Business.All too many... Read More
Setting up a website is the very first step of... Read More
After having decided to start a business, the next thing... Read More
With all of the factors involved in designing and building... Read More
Optimal website design is the art of logical navigation.It will... Read More
Like any area of business your website needs some effort... Read More
First, using a lot of web graphics, flash, banners and... Read More
Simply ensuring your website is accessible to screen reader users... Read More
You've just finished congratulating your marketing team. After six months... Read More
Building a website and getting it online is easy. Driving... Read More
Rosalind wants to share her inspirational poetry with a wider... Read More
Your business website is a critical aspect of being able... Read More
Web Development |