saftutorials.com

HTML

How to download HTMl Editors

How to use HTML tags

How to Comment in HTML

How to create an HTML link

How to link to a specific part of a page HTML

How to Insert Images with HTML

How to insert audio in HTML

How to insert videos in HTML

How to use Table Tag in HTML

How to Use HTML List Elements

How to use HTML Iframe

How to use HTML Symbols

How to use HTML Color Codes

How to Create HTML From

How to learn HTML

CSS

How to use CSS Background

JS

PHP

How to redirect to another page using PHP

How to get last inserted id in MySQL using PHP

How to learn php

How to insert a row into database by using PHP

How to fetch data from table by using php

How to print table data by using while loop in php

How to perform search operation into database by using php

MySQL

How to create Table in PHP MySQL?

How to Insert Data Into MySQL Database Table Using PHP?

How to Select Data from MySQL Database Tables Using PHP

How to Update data in MySQL Database Table using PHP

How to Delete Data from MySQL using PHP

How to make MySQL query ORDER BY conditions

How to Select LIMIT data in PHP MySQL

SQL

BOOTSTRAP

AJAX

DATATABLE

SEO

EARNING

GOOGLE

FACEBOOK

YOUTUBE

WordPress

How to Install WordPress?

How to use WordPress Dashboard?

How to Install Plugins in WordPress?

How to Customize WordPress Plugins?

How to Change General Settings in WordPress?

How to Change Writing Settings in WordPress

How to Setup the Reading Settings in WordPress

How to Setup the Discussion Settings in WordPress

How to Setup the Media Settings in WordPress

How to Setup the Permalink Settings in WordPress

How to Setup the Plugin Settings in WordPress

How to Add Categories to WordPress

How to Edit Category in WordPress

How to Delete Category in WordPress

How to Arrange Category in WordPress

How to Add a new Post in WordPress

How to Edit Post in WordPress

How to Delete Post in WordPress

How to Review Post in WordPress

How to add Media in WordPress

How to Edit Media in WordPress

How to add a Page in WordPress

How to Delete Media in WordPress

How to Add Page in WordPress

How to Edit Pages in WordPress

How to Learn WordPress

How to Delete Page in WordPress

How to add New Tag in WordPress

How to Edit Tags in WordPress

How to Delete Tags in WordPress

How to redirect to another page using PHP

Answer: You can make a redirecting page to another page by using PHP. There are many types redirect system in PHP. Below example:


1. Regular redirect

<?php 
     header('Location: redirectpage.php');
?>



2.using header function with exit()

<?php 
     header('Location: redirectpage.php');exit();
?>



3.without header

<?php 
    echo "<script>location.href='redirectpage.php';</script>";
?>



4.using header function with ob_start() and ob_end_flush()

<?php
ob_start(); // this should be first line of your page
header('Location: redirectpage.php');
ob_end_flush(); // this should be last line of your page
?>



5. Header location change after sometime

<?php
header('refresh:5;url=redirectpage.php '); // Note: here 5 means 5 seconds wait for redirecting.
?>



6. Redirect with a Variable data

<?php
$redirectURL = "http://www.saftutorials.com";
header('Location: '.$redirectURL ;

?>


Find us on

Facebook Google Plus Twitter Pinterest YouTube

web statistic