Php Redirect
|
|
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.
|
|
|
Created & Maintained by Empower! CMS Web Sites
Host2Sell Web Hosting | Emarketing Workshops | Site SEO Review | FREE Newsletter7 Killer Ways To Increase Your Online Sales
Every online entrepreneur I talk to is asking the same question, "How do I increase my online sales, NOW?"Online selling is essentially a numbers game. The more visitors to a site, the more sales that site will make. The number of sales ...(related: Web Development)
Making The Business Case For Web Standards
Through the explosive growth of the Web, companies have realized the benefit of building a strong online presence. By publishing a website to the Internet, companies are able to build their brand, market their products, support existing customers, release publicity pieces, and even take orders. Lost in the feverish pace of growth however, has been an eye on the effect that their current web-building practices have on the bottom line and the future of their online presence. Not only does ...(related: Web Development)
Web Success Secret - Keep Your Visitors Interested
Visitors to your site come looking for information or solutions to their problems. They will remain there if they fin...(related: Web Development)
Growing Your Meetings In Cyberspace
As increasing numbers of people search for information on the Internet, it becomes more imperative to have a compelling Website to promote and suppor...(related: Web Development)
Search Engines And Customers Want Focused Web Site Content
How do you decide on the content, products and or services you will promote on your Web site.Or should I go back one step further and ask why did you decide to create a website in the first place.Just thought I would ask to see...(related: Web Development)
Remember This When Building A New Site - Beginners Guide
I recently helped my mom to launch a website (www.mom2me.com) to publish some of her recipes and it was probably the best wake up call I have had this year. It dawned on me that I actually do not know nearly as much as I thought I did. In fact it was evident that some things are best left to the ...(related: Web Development)
The Evolution Of Search
There have been many significant changes to the face of search over the last several years with engines becoming more intelligent than ever before. Today's users expect mainly fast, easy, relevant and satisfactory search results. In response to this search engines have responded by giving users more control over search results than ever through the emergence of alternative search engines.One instance of these so-called alternative search engines goes by the name of Nutch (http://www.nutch.org/). Nutch is a two-year-old open source project, which has been hosted previously at Soundforge and backed by a non-profit organization. Since...(related: Web Development)
Writing Effective Alt Text For Images
Anyone who knows anything about web accessibility knows that images need alternative, or ALT, text assigned to them. This is because screen readers can't understand images, but rather read aloud the alternative text assigned to them. In Internet Explorer we can see this ALT text, simply by mousing over the image and looking at the yellow tooltip that appears. Other browsers (correctly) don't do this. The HTML for inserting ALT text is:img src="filename.gif" alt="Alternative description goes here"But surely there can't be a skill to writing ALT text for images? You just pop a description in there and you're good to go, right? Well, kind of. Sure, it's not rocket science, but there are a few guidelines you need to follow...S...(related: Web Development)
Developing State-enabled Applications With Php
Installment 1Developing State-enabled Applications With PHPWhen a user is browsing through a website and is surfing from one web page to another, sometimes the website needs to remember the actions (e.g. choices) performed by the user. For example, in a website that sells DVDs, the user typically browses through a list of DVDs and selects individual DVDs for check out at...(related: Web Development)
Free Amber Alert Tickers For Your Website
Project Safekids provides webmasters a valuable tool which could save a child's life. Add our Amber Alert Ticker to your website today.Please visit Http://www.projectsafekids.org/code.html to get an Amber Alert Ticker for your website today.Our Amber Alert News feed displays information about abducted children as it happens. This auto updating content. You simply enter a few lines of html code into your web pages and that's it. If a tip comes from your site which leads to the arrest and conviction of a child abducter you are paid a reward.Project Safekids is a not for profit community service organization dedicated to creating awareness of the dangers that face our children and families daily. Interested in sponsoring an event? Please Contact Us , our trained professionals will hel...(related: Web Development)
9 Simple Steps To Create A Background Tiled Image Branded With Your Name
You have seen those web pages where they have the name of the Name Web repeated over over over in square tiles as the background. Now by following these 9 Simple steps you too can create a web page Branded with your Name, or Company Name.I am far from a graphic designer but by using Microsoft Word and Microsoft Paint and these 9 Simple Steps. I have been able to create Tiled background Images.Step 1Go into Microsoft Word and Create a Word Art with your Text.
- Click on Menu Item Insert then Picture Then Word Art.
- Select a Word Art Template
- Enter Your Word art Text
- Select your Font Style and Size
- Rotate your Word Art (Going from Top Right to Bottom Left seems to work best)
site-map - Copyright © 2006 Empower! Web Design | All Rights Reserved. | Web Development
