PHP: Redirection :-

Techno PHP

Redirection function is used to jump one page to another web page.
In simple words if you have create a page (PHP-redrect-function.php) and when a user open this link then move out another page like (http://technosmarter.com/).

For redirect a page we can use some time like 5 to 10 seconds .
5 to 10 second means your page will redirect another page after 5 to 10 seconds . A simple example of Redirect function.

Example

<?php
header("location:https://technosmarter.com");
?>


header() is used to send a raw HTTP header.


Location – Where you want to move out ..(Web page location)


Now we will create a time duration redirection one page to another .

Example

<?php
header("refresh:5;  url=https://technosmarter.com");
echo "Redirecting.....";
?>
Run

refresh:5 – You will redirect after 5 seconds on another webpage that you have specified in URL .

Related