//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
}