This is what I'm using after every form to go back to the previous page in a multi-page form:
$url = htmlspecialchars($_SERVER['HTTP_REFERER']);
echo "<a href='$url'>GO BACK</a>";
But I'm not sure if it will work fine. Is there any better method for going back to the previous page. I don't want to use header (location:
), maybe multiple submit, i.e. one to submit the form and another for going. But I'm not sure how to implement it properly.