header()
FunctionYou can simply use the PHP header()
function to redirect a user to a different page.
The PHP code in the following example will redirect the user from the page in which it is placed to the URL http://www.example.com/another-page.php
. You can also specify relative URLs.
<?php
header("Location: http://www.example.com/another-page.php");
exit();
?>
If you want to redirect the users from old page to a new page on a permanent basis then also mention HTTP response code in the header()
function as shown in the following example, so that search engines transfer "page rank" from the old page to the new page.
<?php
// 301 Moved Permanently
header("Location: http://www.example.com/another-page.php", true, 301);
exit();
?>
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on harsukh21@gmail.com
Laravel 8 - Excel and CSV Import Export to Database using maatwebsite/excel with Example.
Excel file import-export to the database...How to bind click event to dynamically created HTML elements in jQuery
Use the jQuery on() method...Laravel 5.6 - Multiple File Upload With dropzone.js
Many time you need in your laravel appli...How to Create REST API in Laravel7 using JWT
Hello Artisan In this tutorial...How to Generate a Timestamp in JavaScript
Use the Date.now() Method You can sim...