Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/272.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.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将变量传递到下一页_Php - Fatal编程技术网

Php 通过url将变量传递到下一页

Php 通过url将变量传递到下一页,php,Php,在这里,我正在计算一个配置文件所有者正在跟踪的人数,如果显示所有被跟踪的人员,则输出编号为打开新页面的链接,计数工作正常,给出了被跟踪的人数,但现在要完成我的下一页,请说following.php,其中将显示所有被跟踪的人,我需要将变量$id传递到我要使用url方法的页面,请在这方面帮助我 <?php $checkfollowing =$db->prepare("SELECT * FROM follow_user WHERE uid_fk=:id"); $checkfollowing

在这里,我正在计算一个配置文件所有者正在跟踪的人数,如果显示所有被跟踪的人员,则输出编号为打开新页面的链接,计数工作正常,给出了被跟踪的人数,但现在要完成我的下一页,请说
following.php
,其中将显示所有被跟踪的人,我需要将变量
$id
传递到我要使用url方法的页面,请在这方面帮助我

<?php
$checkfollowing =$db->prepare("SELECT * FROM follow_user WHERE uid_fk=:id");
$checkfollowing->execute(array(':id'=>$id)); 
$count = $checkfollowing->rowCount(); ?>
<a href='following.php' style='text-decoration:none;margin-left:40px;'><?php print $count; ?></a>

您可以通过url传递值,并使用
$\u get
方法在其他页面上获取值。 检查下面的代码

<a href='following.php?id=<?php echo $id ; ?>' style='text-decoration:none;margin-left:40px;'><?php print $count; ?></a>

通过在url末尾指定变量,可以通过url传递变量。像这样

<a href='following.php?count=<?php echo $count; ?>' style='text-decoration:none;margin-left:40px;'><?php print $count; ?></a>


<a href='following.php?id=<?php echo $id; ?>' style='text-decoration:none;margin-left:40px;'><?php print $count; ?></a>