操纵URL

时间:2015-03-23 12:43:34

标签: php html

我希望在发送PM时更改网站上的URL以使用用户点击PM图标并获取URL:

index.php?page=usercp&do=pm&action=edit&uid=10&what=new&to=ObieWan

我需要该网址才能让任何用户向ObieWan发送PM,但是因为它使用我的10的uid而无法工作。 该链接如下所示,位于.php文件中:



<a href="http://domain.com/index.php?page=usercp&do=pm&action=edit&uid=10&what=new&to=ObieWan"><font size="1">PM ObieWan</font></a>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:0)

获取当前用户的ID并将其提供给网址,如:

<?php
echo"
<a href='index.php?
page=usercp&do=pm&action=edit&uid='".$id."'&what=new&to=ObieWan'>This is the link
</a>";
?>

我不知道你的其余代码或数据库结构,所以你应该从你想要的用户那里获得ID。这是传递当前用户ID的方法

答案 1 :(得分:0)

如果您要更改它的uid,则可以使用$ _GET ['uid']进行设置。

相关问题