php在输出语句中怎样向另一个页面传值。 10
<?include"frist.php";include"conn.php";if($_POST['del']){if($_POST[id]){echo"<scriptl...
<?
include "frist.php";
include "conn.php";
if ($_POST['del']){
if($_POST[id]){
echo "<script language=\"javascript\">confirm('你确定删除本条留言吗??');</script>";
$sql4="DELETE FROM `message` WHERE `message`.`id` =$_POST[id];";
mysql_query($sql4);
}else {
echo "<script language=\"javascript\">alert('请先选择你要删除的留言内容');</script>";
}
}
if ($_POST['update']){
if($_POST[id]){
$id=$_POST[id];
echo "<script language=\"javascript\">location.href='update.php'?$id</script>";
}else {
echo "<script language=\"javascript\">alert('请先选择你要修改的留言内容');</script>";
}
}
?>
<form action="newselect.php" method="post" name="selectname" >
<table width=500 border="0" align="left" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
$sql3="SELECT * FROM message order by id ASC";
$query= mysql_query($sql3);
while ($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td><input type="checkbox" value="<?=$row[id]?>" name="id"/>用户:<?=$row[user]?>
标题:<?=$row[title]?>发表内容:<?=htmtocode($row[content]);?>
</td>
</tr>
<?
}
?>
</table>
<input type="submit" name="del" value="删除" ;/>
<br><br>
<input type="submit" name="update" value="更改" ;/>
</form>
怎样向新的update.php传递参数,update.php,怎样接收传过来的参数. 展开
include "frist.php";
include "conn.php";
if ($_POST['del']){
if($_POST[id]){
echo "<script language=\"javascript\">confirm('你确定删除本条留言吗??');</script>";
$sql4="DELETE FROM `message` WHERE `message`.`id` =$_POST[id];";
mysql_query($sql4);
}else {
echo "<script language=\"javascript\">alert('请先选择你要删除的留言内容');</script>";
}
}
if ($_POST['update']){
if($_POST[id]){
$id=$_POST[id];
echo "<script language=\"javascript\">location.href='update.php'?$id</script>";
}else {
echo "<script language=\"javascript\">alert('请先选择你要修改的留言内容');</script>";
}
}
?>
<form action="newselect.php" method="post" name="selectname" >
<table width=500 border="0" align="left" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
$sql3="SELECT * FROM message order by id ASC";
$query= mysql_query($sql3);
while ($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td><input type="checkbox" value="<?=$row[id]?>" name="id"/>用户:<?=$row[user]?>
标题:<?=$row[title]?>发表内容:<?=htmtocode($row[content]);?>
</td>
</tr>
<?
}
?>
</table>
<input type="submit" name="del" value="删除" ;/>
<br><br>
<input type="submit" name="update" value="更改" ;/>
</form>
怎样向新的update.php传递参数,update.php,怎样接收传过来的参数. 展开
6个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询