在我的源當我按下刪除按鈕,isset代碼中沒有任何excuted.can一個幫助我,PHP ISSET函數不Excuted
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<?php
$dbc=mysqli_connect("localhost","root","","elvis_store") or die("Error Connecting to Mysql Database");
if(isset($_POST['submit'])){
echo "Hello";
foreach($_POST['todelete'] as $delete_id){
$query="DELETE FROM email_list WHERE id=$delete_id";
mysqli_query($dbc,$query) or die("Error Querying Database");
}
echo "Customer(s) Removed";
}
$query="SELECT * FROM email_list";
$result=mysqli_query($dbc,$query)or die("Query Syntaxt is Incorrect");
while($row=mysqli_fetch_array($result)){
echo '<input type="checkbox" value="' . $row['id'] . '" name="todelete[]" />';
echo $row['first_name']." ".$row['last_name']." ".$row['email'];
echo "<br/>";
}
mysqli_close($dbc);
?>
<input type="submit" name"submit" value="Remove"/>
</form>
</body>
請更新與完整的代碼和格式化後你的答案。 – y2ok 2012-07-24 08:12:27
你爲什麼一定'submit'變量被髮送? – zerkms 2012-07-24 08:15:21
也許你還沒有發佈'提交';變量在你的形式? – pankar 2012-07-24 08:16:02