如何在php中获取查询字符串变量

如何在php中获取查询字符串变量,php,Php,我有一个php for循环,在php for循环中,td标记中有一个按钮元素。我使用查询字符串将按钮Id从一个页面传递到另一个页面 第1页: $id = $data['no']; <td><button class="btn btn-primary btn-small"><a href="votingPoll.php?'.$str.'">SUBMIT</a></button></td> 但由于某些原因,它在第2页给了我一

我有一个php for循环,在php for循环中,td标记中有一个按钮元素。我使用查询字符串将按钮Id从一个页面传递到另一个页面

第1页:

 $id = $data['no'];
<td><button class="btn btn-primary btn-small"><a href="votingPoll.php?'.$str.'">SUBMIT</a></button></td>
但由于某些原因,它在第2页给了我一个未定义变量“str”的错误。

将代码更改为:

<td><button class="btn btn-primary btn-small"><a href="votingPoll.php?id='.$id .'">SUBMIT</a></button></td>

在yourpage.php或任何您想要接收数据的文件上,使用第1页的$_GET['id']

添加var_dump$str;并用输出更新您的问题。谢谢,您能解释一下如何在查询字符串多id中发送多个值吗?或者不同的数据类型?我想是多个id。
<td><button class="btn btn-primary btn-small"><a href="votingPoll.php?id='.$id .'">SUBMIT</a></button></td>