Web Development Information

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.


MORE RESOURCES:

Frugal Duchess: Goal-setting
Bellingham Herald, WA - 18 hours ago
Goal setting is an annual exercise as we try to whip our home and other fiscal assets into better shape. And so we crunch numbers and try to tone up our ...


Goal-Setting Drills Make for More Active Coworkers
Newswise (press release) - Jan 5, 2009
“They had individual goal setting — a common technique — but they also had group and organizational goal setting, which provided the peer encouragement that ...
Employer-Sponsored Workouts Boost Workers' Health Washington Post
all 17 news articles


Missoula officials offer New Year's goal setting tips
KPAX-TV, MT - Jan 2, 2009
Missoula City-County Health officials say the new year is a great time to re-commit to new health goals. Here are some goals they recommend striving for ...


Woman Who Lost 100 Pounds Opens Goal-Setting Social Network
PR.com (press release), NY - Jan 2, 2009
Woman who lost 100 pounds shares how to set and achieve your goals through a new goal-setting social network site whose launch date coincides to help make ...


HealthNews

Goal-Setting Tips for the Whole Family
HealthNews, CA - Dec 29, 2008
Goal setting is an important method of deciding what’s important in your life. Since accomplishing these goals builds self-confidence, goal setting is a ...


1/6/2009 - CAP Seminars Focus on the Self and Home
Inland Empire, CA - 17 hours ago
Goal Setting from instructor Letty Herndon teaches how to set specific, attainable and measurable goals that are both realistic and time-bound. ...


Setting effective financial goals for 2009
The Punch, Nigeria - Jan 3, 2009
For instance, Dr. Ron Dontroy, a leading human resource expert and author, The Art of Future Management, likens goal setting to a compass that provides the ...


Goal setting Pacers eye Fraser Valley berth
South Delta Leader, Canada - Jan 1, 2009
By Philip Raphael - South Delta Leader Weeks into the senior girls basketball season, Delta Secondary head coach Bill Lambert says his team is still in ...


Examiner.com

Goal setting for 2009: book projects
Examiner.com - Dec 29, 2008
by Wendy Attmore, Atlanta Writing Careers Examiner Now’s the time to start mapping out some self-imposed deadlines for your book projects. ...


Goal-Setting In A Recession
Forbes, NY - Dec 15, 2008
It will match our needs in terms of the number of quarters/years to yield. It will match our portfolio of products/services/offers. ...

Goal-Setting - Google News

home | site map | ArticleGecko | A ClashX Production 2006
© 2006