日期:2014-05-17  浏览次数:20379 次

PHP 获取 form URL 【急,在线等】
有两张页面。

index.html 和 index_do.php

index.html:

<form name="userlogin" action="/member/index_do.php" method="POST">
    <label>帐&nbsp; 号</label><input type="text" name="userid"/>
    <label>密&nbsp; 码</label><input type="password" name="pwd"/>
    <input type="submit" value="立即登录" />
</form>



PHP:怎样获取来自页面的提交地址?

因为index.html是被N张页面调用的。


比如以下页面调用了index.html提交了登录数据:
①、http://localhost/
②、http://localhost/works/
③、http://localhost/works/end/index.html


想要的结果:
index_do.php
<?php
//页面③中提交了登录数据
echo "你是从以下地址中登录的:"."http://localhost/works/end/index.html";
?>



求大神
PHP URL label

------解决方案--------------------
$_SERVSR['HTTP_REFERER']
------解决方案--------------------
再加一个隐藏的input,其值为action
------解决方案--------------------
建议你去看看PHP的$_SERVSR用法
------解决方案--------------------
直接在页面上把$_SERVSR打印出来看看也许会有更深刻的认识