Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to redirect to previous page in php

//index.php
<form action ="home.php" method = "POST">
<button type="submit" name="button"> Submit</button>
</form>
 //---------------------------------------------------------------- 
//home.php
if(isset($_POST['button'])){
 echo $_SERVER[HTTP_REFERER];//redirects to the page where the button was clicked
}
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #redirect #previous #page #php
ADD COMMENT
Topic
Name
7+8 =