Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 传递URL不会输出带有echo的变量_Php_Html_Variables_Url - Fatal编程技术网

Php 传递URL不会输出带有echo的变量

Php 传递URL不会输出带有echo的变量,php,html,variables,url,Php,Html,Variables,Url,链接页面: <a href="displayProduct.php?productID=<?php'.$pID.'?>"> 您错过了一个回音,出现了一些奇怪的连接 <a href="displayProduct.php?productID=<?php'.$pID.'?>"> 最短路径: <a href="displayProduct.php?productID=<?php echo $pID ?>"> 对我来说很好。请

链接页面:

<a href="displayProduct.php?productID=<?php'.$pID.'?>">

您错过了一个回音,出现了一些奇怪的连接

<a href="displayProduct.php?productID=<?php'.$pID.'?>">
最短路径:

<a href="displayProduct.php?productID=<?php echo $pID ?>">

对我来说很好。请参阅。我正在从数据库获取数据,并通过while循环输出数据列表。while循环是否干扰了它?while循环是什么?是的,可能是数据库中的坏数据。我建议您转储数据或手动浏览以验证其正确性。在回显之前,我可以将唯一的productID传递到displayProduct页面的URL上。我认为这很好,但是现在使用link语句中的echo,它仍然没有将变量输出到页面上。我设法修复了它。我用了我的老方法,但忘记了它仍然在回显字符串,并且变量没有被视为变量。。。我会接受你的回答,因为你一直在帮助我,而且我相信你的方法也会奏效。
<a href="displayProduct.php?productID=<?php echo $pID; ?>">
<a href="<?php echo 'displayProduct.php?productID=' . $pID; ?>">
<a href="displayProduct.php?productID=<?php echo $pID ?>">