php得到来源页面的url,在线等 php得到来源页面的url比如,a.php的页面含有b.php的链接,用户从a.php页面进了b.php页面,现要得到b.php页面的来源页面a.php,怎么得到呀,thanks.. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 a.php的页面含有b.php的链接 在这个b.php的链接中加个标志位flag=a 多谢楼上的,我想用php函数得到来源页面的url echo getenv("HTTP_REFERER");//和$_SERVER("HTTP_REFERER");一样的作用 //pares_URL()解析url echo $_SERVER['HTTP_REFERER'];方法二:你看下载资源时,csdn 登陆时,会将来源页面做为参数传递。 自己的网站用参数传递即可别人的网站点到你的网站用HTTP_REFERER两者都容易伪造 请参照 SERVER 服务器变量 用JavaScript来获取吧....如果是用php函数来获取的话,a连接会获取不到...<table width=100% cellpadding=0 cellspacing=0 border=0 ><script>thisURL = document.URL;thisHREF = document.location.href;thisSLoc = self.location.href;thisDLoc = document.location;strwrite = "<tr><td valign=top>thisURL: </td><td>[" + thisURL + "]</td></tr>"strwrite += "<tr><td valign=top>thisHREF: </td><td>[" + thisHREF + "]</td></tr>"strwrite += "<tr><td valign=top>thisSLoc: </td><td>[" + thisSLoc + "]</td></tr>"strwrite += "<tr><td valign=top>thisDLoc: </td><td>[" + thisDLoc + "]</td></tr>"document.write( strwrite );</script>thisDLoc = document.location; <BR>thisURL = document.URL; <BR>thisHREF = document.location.href; <BR>thisSLoc = self.location.href;<BR><script>thisTLoc = top.location.href;thisPLoc = parent.document.location;thisTHost = top.location.hostname;thisHost = location.hostname;strwrite = "<tr><td valign=top>thisTLoc: </td><td>[" + thisTLoc + "]</td></tr>"strwrite += "<tr><td valign=top>thisPLoc: </td><td>[" + thisPLoc + "]</td></tr>"strwrite += "<tr><td valign=top>thisTHost: </td><td>[" + thisTHost + "]</td></tr>"strwrite += "<tr><td valign=top>thisHost: </td><td>[" + thisHost + "]</td></tr>"document.write( strwrite );</script>thisTLoc = top.location.href; <BR>thisPLoc = parent.document.location; <BR>thisTHost = top.location.hostname; <BR>thisHost = location.hostname;<BR><script>tmpHPage = thisHREF.split( "/" );thisHPage = tmpHPage[ tmpHPage.length-1 ];tmpUPage = thisURL.split( "/" );thisUPage = tmpUPage[ tmpUPage.length-1 ];strwrite = "<tr><td valign=top>thisHPage: </td><td>[" + thisHPage + "]</td></tr>"strwrite += "<tr><td valign=top>thisUPage: </td><td>[" + thisUPage + "]</td></tr>"document.write( strwrite );</script><tr><td> 这条语句哪出错了 php表格数据输入(初学问题) PHP Exception 讨论 php javascript 求救:如何对中文URL参数进行解码 文件上传问题 删除文件问题。请大家帮帮忙。 MySQL 急救!!! ThinkPhp ajax 提交 php多维数组去重 form里两个submit时的参数传递 新手求教,这种是怎么实现的?
//pares_URL()解析url
你看下载资源时,csdn 登陆时,会将来源页面做为参数传递。
别人的网站点到你的网站用HTTP_REFERER两者都容易伪造
如果是用php函数来获取的话,a连接会获取不到...<table width=100% cellpadding=0 cellspacing=0 border=0 ><script>thisURL = document.URL;thisHREF = document.location.href;thisSLoc = self.location.href;thisDLoc = document.location;strwrite = "<tr><td valign=top>thisURL: </td><td>[" + thisURL + "]</td></tr>"strwrite += "<tr><td valign=top>thisHREF: </td><td>[" + thisHREF + "]</td></tr>"strwrite += "<tr><td valign=top>thisSLoc: </td><td>[" + thisSLoc + "]</td></tr>"strwrite += "<tr><td valign=top>thisDLoc: </td><td>[" + thisDLoc + "]</td></tr>"document.write( strwrite );</script>thisDLoc = document.location; <BR>thisURL = document.URL; <BR>thisHREF = document.location.href; <BR>thisSLoc = self.location.href;<BR><script>thisTLoc = top.location.href;thisPLoc = parent.document.location;thisTHost = top.location.hostname;thisHost = location.hostname;strwrite = "<tr><td valign=top>thisTLoc: </td><td>[" + thisTLoc + "]</td></tr>"strwrite += "<tr><td valign=top>thisPLoc: </td><td>[" + thisPLoc + "]</td></tr>"strwrite += "<tr><td valign=top>thisTHost: </td><td>[" + thisTHost + "]</td></tr>"strwrite += "<tr><td valign=top>thisHost: </td><td>[" + thisHost + "]</td></tr>"document.write( strwrite );</script>thisTLoc = top.location.href; <BR>thisPLoc = parent.document.location; <BR>thisTHost = top.location.hostname; <BR>thisHost = location.hostname;<BR><script>tmpHPage = thisHREF.split( "/" );thisHPage = tmpHPage[ tmpHPage.length-1 ];tmpUPage = thisURL.split( "/" );thisUPage = tmpUPage[ tmpUPage.length-1 ];
strwrite = "<tr><td valign=top>thisHPage: </td><td>[" + thisHPage + "]</td></tr>"strwrite += "<tr><td valign=top>thisUPage: </td><td>[" + thisUPage + "]</td></tr>"document.write( strwrite );</script><tr><td>