Redirect php web page using PHP header loaction redirect script.-php redirection
Posted by Raj
Redirect php page To Another web page URL using PHP header loaction redirect script-php redirection
You can easily redirect php page to the different web page using PHP header() function
the following PHP script redirect the user to rajeshstutorials.blogspot.com
<?php
header( 'Location: http://rajeshstutorials.blogspot.com/' ) ;
?>
The header() is used to send a raw HTTP/1.1 specification specific header.
header() must be called before any actual output is sent,
below redirect script will NOT work, the browser received the HTML tag before the script
<html>
<?php
header( 'Location: http://rajeshstutorials.blogspot.com/' ) ;
?>
make sure,it will not work if you sent any data to the browser before this function.
if you write echo or print or any HTML statements or before the website redirection you will get an error,to avoid this use PHP output buffering as follows
<?php
ob_start();
echo 'php header Location Script';
header( 'Location: http://rajeshstutorials.blogspot.com/' ) ;
ob_flush();
?>
You can easily redirect php page to the different web page using PHP header() function
the following PHP script redirect the user to rajeshstutorials.blogspot.com
<?php
header( 'Location: http://rajeshstutorials.blogspot.com/' ) ;
?>
The header() is used to send a raw HTTP/1.1 specification specific header.
header() must be called before any actual output is sent,
below redirect script will NOT work, the browser received the HTML tag before the script
<html>
<?php
header( 'Location: http://rajeshstutorials.blogspot.com/' ) ;
?>
make sure,it will not work if you sent any data to the browser before this function.
if you write echo or print or any HTML statements or before the website redirection you will get an error,to avoid this use PHP output buffering as follows
<?php
ob_start();
echo 'php header Location Script';
header( 'Location: http://rajeshstutorials.blogspot.com/' ) ;
ob_flush();
?>
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
header location,
header php,
page redirect php,
php header location,
php page redirect,
php redirect to page,
php redirection,
redirect in php,
redirect php,
redirect script,
website redirection
.You can leave a response, or trackback from your own site.