如何获取当前页面的url地址并传值到另一页面并写入数据库中,请教代码怎么写?
我这里有一段获取代码,
window.location.href = "/abc.php?url=" + escape(window.location.pathname);不知道对不对
我这里有一段获取代码,
window.location.href = "/abc.php?url=" + escape(window.location.pathname);不知道对不对
如果要取得整个URl字符串(在浏览器中就是完整的地址栏),用window.location.href
php 就用header
//获取传递过来的url$relation_qq = $db->exe_sql("select `relationqq` from `data001` WHERE `url` LIKE '%{$nowurl}'");
$info_title = mysql_fetch_assoc($relation_qq);
$info_qq = $info_title["relationqq"];
echo "<a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin=".$info_qq."&Site=http://www.abc.com&Menu=yes><img border="0" SRC=http://wpa.qq.com/pa?p=13:".$info_qq.":13 alt="有事Q我"></a>"";
if(!empty($info_qq)){
echo "<a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin=".$info_qq."&Site=http://www.abc.com&Menu=yes><img border="0" SRC=http://wpa.qq.com/pa?p=13:".$info_qq.":13 alt="有事Q我"></a>";}
border='0'
alt='有事Q我'
或者:
border=\"0\"
alt=\"有事Q我\"
echo "<a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin=".$info_qq."&Site=http://www.abc.com&Menu=yes><img border='0' SRC=http://wpa.qq.com/pa?p=13:".$info_qq.":13 alt='有事Q我'></a>";}
现在提示这个,似乎url没有传递过去
print_r($info_title); 什么结果
$nowurl=$_GET['url'];下面加上:
echo $nowurl;