Web-development informational articles

Php redirect - web-development


A PHP Redirect consequentially transfers a web user from one URL to another. For example, typing foo. com in the browser certainly transfers the user to a new 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 feasible to use other redirects:

* HTTP Redirects

Replace [time] with seconds. This will pause the browser for the individual add up to of seconds. Put back [some-url] with the aim at URL you want to redirect.

For example,

The above HTTP based redirect needs to be in the county of the HTML code.

* JavaScript Redirects

setTimeout("location. href='[some-url]'", [time]);

Replace [time] with milliseconds. This will pause the browser for the precise come to of seconds. Exchange [some-url] with the affect URL you want to redirect.

For example, setTimeout("location. href='http://www. yahoo. com'", 5000);

The above JavaScript based redirect can be any in the or constituency of the HTML code.

Usually a PHP redirect is much more trustworthy than other form of redirects like HTTP redirect or JavaScript based redirects. For case in point a JavaScript redirect may not work if a user's browser settings has JavaScript bowed off.

The basis why PHP redirects will work no be relevant what settings users have on their browser is for the reason that PHP is head waiter side script. It will not depend on browser settings that may concern JavaScript which is parsed on the client-side/user-side.

About the Author
Sanjib Ahmad, Ad hoc Critic and Creation Consultant for http://www. marc8. com.

You are free to use this commentary in its entirety as long as you leave all links in place, do not alter the content, and consist of the supply box scheduled above.

Web development: A gap in education  Tennessee Tech Oracle

Why Use Minifier? -  VENTS Magazine

What Is Web Design?  Technology Zimbabwe

The Future of Web Development  Business 2 Community

Developed by:
home | site map
goldenarticles.net © 2020