我想使用href链接进行多次删除,该怎么办?
此代码生成给定的以下错误。
Notice: Undefined index: action in
C:\xampp\htdocs\montu\montu\multiple.php on line 32
Warning: implode() [function.implode]: Invalid arguments passed in
C:\xampp\htdocs\montu\montu\multiple.php on line 32
<body>
<form method="post" action="<?php $_PHP_SELF ?>">
<table>
<tr>
<td>
<input type="checkbox" name="action[]" value="1">1
</td>
<td>
<input type="checkbox" name="action[]" value="2">2
</td>
</tr>
<tr>
<td>
<a href="?id">Click Me..</a>
</td>
</tr>
</table>
</form>
<?php
if(isset($_REQUEST['id']))
{
$action=implode(',',$_REQUEST['action']);//convert array value to string values
echo $action;
}
?>
请这样尝试。
<?php
if(isset($_POST['action']))
{
//print_r($_REQUEST);
$action=implode(',',$_REQUEST['action']);//convert array value to string values
echo $action;
}
?>
<body>
<form name="frm" id="frm" method="post">
<table>
<tr>
<td>
<input type="checkbox" name="action[]" value="1">1
</td>
<td>
<input type="checkbox" name="action[]" value="2">2
</td>
</tr>
<tr>
<td>
<a onclick="document.forms['frm'].submit()" href="#">Click Me..</a>
</td>
</tr>
</table>
</form>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句