回到php中的前一页,其中前一页的url应该取自firefox地址栏


Go back to previous page in php where previous page url should taken from the firefox address bar

我创建了一个应用程序来检查网页中的恶意url。在这我已经创建了一个页面调用错误。php将打开当用户点击网页中的恶意链接。我想回到前一页,即已经在用户浏览器中加载了恶意内容的页面。

例如:我想去页/localhost/url/page1.php?url=www.google.com后按下按钮在error.php页。

我的程序是用php写的。

你有两种选择:

  1. 使用javascript获取document.referrer
  2. 链接
  3. 解析url的引用,例如www.mysite.com/check.php?referrer=www.google.com。然后通过$_GET['referrer']获取referrer,并将其回显到链接。

在error.php中编写一个点击按钮

的javascript函数
 <script type="text/javascript">
 function goback()
 {
 window.history.back()
 }
 </script>