如何在同一页面上用php编写get值
嗨,我做了一个php代码,但它不工作,我不知道为什么 这是我的密码 update.php如何在同一页面上用php编写get值,php,mysql,Php,Mysql,嗨,我做了一个php代码,但它不工作,我不知道为什么 这是我的密码 update.php <?php $link=mysql_connect("localhost","root","root"); mysql_select_db("helixcrm",$link); $q="select * from clientreg"; $ros=mysql_query($q); $i=0; while($row=mysql_fetch_array($ros)) { if($i
<?php
$link=mysql_connect("localhost","root","root");
mysql_select_db("helixcrm",$link);
$q="select * from clientreg";
$ros=mysql_query($q);
$i=0;
while($row=mysql_fetch_array($ros))
{
if($i%2==0)
$classname="evenRow";
else
$classname="oddRow";
?>
<tr class="<?php echo $classname;?>">
<td><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" ></td>
</tr>
<?php
$i++;
}?>
<?php
$focus = array();
$rowCount = count($_Post["users"]);
echo $rowCount;
for($i=0;$i<$rowCount;$i++) {
$result = mysql_query("SELECT * FROM clientreg WHERE Id='" . $_POST["users"][$i] . "'");
$row[$i]= mysql_fetch_array($result);
//echo $row[$i]['interest'];
$focus = explode(',', $row[$i]['interest']);
$check = implode(',' , $focus);
// echo $check;
echo $row[$i]['id'];
}
?>
<form>
</form>
在这里,我使用这个代码$rowCount=count($\u Post[“users”])不在这里工作,但是如果我在另一个php页面上写这个,它就可以工作了
我错在哪里
如何实现我的输出
任何帮助都将不胜感激试着这样做
<?php
if (isset($_POST['submit'])) {
$example = $_POST['example'];
$example2 = $_POST['example2'];
echo $example . " " . $example2;
}
?>
<form action="" method="post">
Example value: <input name="example" type="text" />
Example value 2: <input name="example2" type="text" />
<input name="submit" type="submit" />
</form>
示例值:
示例值2:
变量是$\u POST
,而不是$\u POST
。危险:您正在使用并且应该使用。你也很容易受到现代API的影响,因为它会让你更轻松。你很容易受到@Barmar的影响我不明白你说了什么$\u Post[“users”]
应该是$\u Post[“users”]
。PHP变量区分大小写。