简体   繁体   English

href链接上的php语法问题

[英]Issue with php syntax on href link

I have this code which i want to use in order to access a page, with the id of the product. 我有此代码,我想使用该代码访问带有产品ID的页面。

The issue is, i don't get the id on the link.. what am i doing wrong here? 问题是,我没有在链接上获得ID。.我在这里做错了什么?

   echo'<a href="pershkrim.php?id="'.$row["id"].'"">"'.$row["id"].'"</a>';

Thanks. 谢谢。

Try this instead : 试试这个代替:

echo'<a href="pershkrim.php?id='.$row["id"].'">"'.$row["id"].'"</a>';

The problem was that with your echo your link looked like this: 问题是,随着您的回声,您的链接看起来像这样:

<a href="pershkrim.php?id="777">"777"</a>';

您的引号过多,并且在链接中的ID之前关闭

echo'<a href="pershkrim.php?id='.$row["id"].'">'.$row["id"].'</a>';

改成

echo'<a href="pershkrim.php?id='.$row["id"].'">'.$row["id"].'</a>';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM