Google
Useful Links: ____ Article Search -___ Link Parters ___- Ebook Library___- Product Search

place1holder

.
New Articles
Ebook Library
Link Exchange
Advertising Space
Computer Directory
Join Our Newsletter

Name:
Email:


You will recieve a weekly email that contains new articles, useful product recommendations & more! [Privacy]



place2holder



Further
Reading ...
Avoiding Phone Taps
When you want to avoid phone taps on your line, one of the things you need to do is get a bug sweeper. These devices can help you find phone taps in your home that may be allowing others to get information that you do not want them to have. Regular...

New "Goodies" At Google
New "Goodies" At Google - by Jim Edwards © Jim Edwards - All Rights reserved http://www.thenetreporter.com -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Search giant, Google.com, recently expanded their reach yet again by offering new and expanded...

Info Products - A Smart Start
© 2004, John Calder http://www.TheEzine.net All Internet marketing, at the bottom line, is about selling something, either a product or service. The goal being to serve your customers and thereby earn a profit. New marketers often get started as an...

Recordable DVD formats explained
Picking your way through the ton of information available on recordable DVD formats can be a nightmare. To help you out, we’ve done our best to distill it into this summary. There are five recordable versions of DVD; DVD-R for General, DVD-R for...


 

PHP Redirect




Written By:
Sanjib Ahmad

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:

<?php
header("location: [some-url]");
?>

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
<meta http-equiv="Refresh" content="[time]; URL=[some-url]">

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,
<meta http-equiv="Refresh" content="5; URL=http://www.yahoo.com">

The above HTTP based redirect needs to be in the <header></header> region of the HTML code.

* JavaScript Redirects

<script language=javascript>
setTimeout("location.href='[some-url]'", - continued below ...





continued ...
[time]);
</script>

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 <header></header> or <body></body> 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 Business.Marc8.com - Best Selling Business Books. 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.


_Additional Resources ...









Next-gen BitDefender solution adds heuristic spam filters
BitDefender 8 SpamDeny, the new antispam solution for Windows workstations launched today is an advanced email protection tool which features updated, as well as new filters. “I’m very satisfied with how this version has turned out, because internal...

Unlimited Bandwidth and Overselling
<h1>Unlimited Bandwidth and Overselling</h1> One of the most controversial topics surrounding web hosting is the practice of overselling bandwidth, and rightfully so. The practice of overselling has enormous potential for disaster -...

What is broadband?
Defining broadband can get complicated There are many different takes on how to actually define the word: broadband. The first and most obvious way to define it is a transmission medium that allows for multiple pathways and types of data, far...



This website is powered by Hostland ...