如何检索链接名称?

时间:2017-02-09 18:16:44

标签: php

我有一个数据库,我生成了一个代码,根据数据库中人员的名称创建链接,我希望名称是 "发送"在下一页(链接的页面)。所以我使用了方法" get"要做到这一点,但它不起作用,我不知道为什么。

$sql = "SELECT * FROM table_personne; ";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
    // output data of each row
    while($row = mysqli_fetch_assoc($result)) {

        echo ("<a href=\"traitement.php?firsname=".$row["firsname"]."%"."&lastname=".$row["lastname"]."%".">".$row["firsname"]. " ".$row["lastname"]);
        echo "<br>";
    }
} else {
    echo " 0 results";
}

创建的网址为:traitement.php?prenom=paul%&nom=vincent%>paul%20vincent

问题:网址与显示的人的姓名不一致,姓氏为"vincent%>paul",表示lastname=$GET["lastname"]= "firstname%lastname<"且没有$GET["firstname"]

非常感谢。

2 个答案:

答案 0 :(得分:0)

这个怎么样:

public class CustomEntryImpl extends SyndEntryImpl {

    protected Date pubDate;

    @Override
    public Date getPublishedDate() {
        return pubDate;
    }

    @Override
    public void setPublishedDate(final Date pubDate) {
        this.pubDate = new Date(pubDate.getTime());
    }
}

答案 1 :(得分:0)

也许你必须改变这个:

$row["firsname"]

$row["firstname"]
相关问题