php中實現退後功能

1.頁面連接php

 

<html>
<head>
</head>
<body>
<a href="test.php">測試</a>
</body>

</html>html

 

2.連接頁面,首先記錄下上頁的URL 賦值給一個變量,利用header來跳轉。測試

<?php $now_url = $_SERVER[HTTP_REFERER] //記錄來訪URL header('location:'.$now); //跳轉回去 ?>
相關文章
相關標籤/搜索