如何在点击php中的链接后在URL上显示id?

时间:2016-12-15 09:52:41

标签: php url

我创建了一个表单。用户将提交表单并收到包含该链接的电子邮件。点击链接后,我必须在URL上显示Id。你能帮我解决这个问题吗?

futures.get(Boolean.FALSE)

我正在获取URL

的输出
if (isset($result->num_rows) > 0) {
    while($row = $result->fetch_assoc()) {
        $User_id = $row['User_id'];
      }}

  echo $User_id;// I am able to display id here

    $message = "
    <html>
    <head>
    <title>HTML email</title>
    </head>
    <body>
    <a href='http://localhost/in/abc.php?user_id='" .$User_id. ">Click here</a>
    </body>
    </html>
    ";

2 个答案:

答案 0 :(得分:2)

我刚刚完成了:

echo $User_id;// I am able to display id here

    $message = "
        <html>
        <head>
        <title>HTML email</title>
        </head>
        <body>
        <a href='http://localhost/in/abc.php?user_id='$User_id1'>Click here</a>
        </body>
        </html>
        ";

您不需要连结?user_id='$User_id1'>

答案 1 :(得分:1)

你需要修复你正在使用的两个变量的代码,你也缺少引用`

<a href='http://localhost/in/abc.php?user_id='" .$User_id1. ">Click here</a>

<a href='http://localhost/in/abc.php?user_id=" .$User_id."'>Click here</a>

应该是,

$message = "
        <html>
        <head>
        <title>HTML email</title>
        </head>
        <body>
        <a href='http://localhost/in/abc.php?user_id=".$User_id."'>Click here</a>
        </body>
        </html>";