这是我的代码:
<?php
ob_start();
session_start();
require 'connection.php';
require 'core.inc.php';
?>
<?php
$take_thread_pid_query = @mysql_query(" select pid from threads ");
$row_take_thread_pid = mysql_fetch_array($take_thread_pid_query);
$pid = $row_take_thread_pid['pid'];
while($row_take_thread_pid = @mysql_fetch_array($take_thread_pid_query))
{
?>
<form action="kill_threads.php" method="POST" >
<label> <?php echo "<br/><br/>thread".$row_take_thread_pid['pid']; ?><input type="submit" value = " <?php echo $row_take_thread_pid['pid'];?> " name = " <?php echo
$row_take_thread_pid['pid']; ?> " /> </label>
<?php }?>
</form>
<?php
$t = "4756";//[4756 is on of the pids in my thread table].this is for testing but doesnt works,it cant find any button with this name.
if ( isset($_POST[$t] ) ) echo "im a killed thread..";
?>
最大的问题是我试图为我创建的每个按钮赋予不同的名称,但这似乎不起作用,因为当我试图查看按钮是否设置时 ['???']
我该怎么办...?
例如
线程 1 [按钮 1]
线程 2 [按钮 2]
线程 3 [按钮 3]
因此,如果现在我单击按钮 1,我希望从数据库中删除 thread1 行。
phpmyadmin 是这样工作的。
我很复杂..请帮助,提前谢谢。