我想从一页到另一页获取 id,但只有我检查过的那些 id。
这是我的代码:
<html>
<body>
<form action="del_novica_admin_sql.php" methos="POST">
<table border="2">
<?php
$st=0;
include 'povezava_na_bazo.php';
include 'session.php';
$result = mysqli_query($con,"SELECT * FROM novice_i ni INNER JOIN uporabniki u ON ni.id_u=u.id_u
WHERE id_i='$_SESSION[igralec]' AND $_POST[vrsta]='1'");
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row['up_ime']; ?> </td>
<td><?php echo $row['novica']; ?></td>
<td><input type="checkbox" name="zbrisi<?php echo $st;?>" value="<?php echo $row['id_ni'];?>" ><br></td>
</tr>
<?php
$st++;
}
?>
</table>
<input type="hidden" name="st" value="<?php echo $st; ?>" >
<input type="submit">
</form>
</body>
第 2 页,del_novica_admin_sql.php 是第 2 页的名称:
<?php
include 'povezava_na_bazo.php';
$sts=0;
$st = $_POST['st'];
$z='zbrisi'.$sts;
echo $z;
while ($sts < $st)
{
echo $_POST[$z];
$sts++;
}
?>
第一次发帖,希望大家知道我问了什么。:)