我使用以下代码从网址显示字符串,它工作正常。但是,如果初始引用页面是我的搜索页面,我只想使用此代码:
<?php
session_start();
if ( !isset( $_SESSION["origURL"] ) )
$_SESSION["origURL"] = $_SERVER["HTTP_REFERER"];
$mysearchterm = $_SERVER["HTTP_REFERER"];
$whatIWant = substr($mysearchterm, strpos($mysearchterm, "=") +1);
echo $whatIWant;
?>