点击提交按钮时不重新加载

时间:2011-04-21 07:22:36

标签: php

这是我的代码:

member.php(页面)

<?php

$membertype=$_POST['txtmtn'];
$bookalit=$_POST['txtbal'];
$issueprd=$_POST['txtisp'];
$finegp=$_POST['selectfinegp'];
include '../connection.php';


if(isset($_POST['bttnsave']))
{
$sql="UPDATE member_type SET BookAllotmentLimit='$bookalit', IssueForPeriod='$issueprd',
FineGroupName='$finegp' WHERE MemberTypeName='$membertype'";
$res=mysql_query($sql);
}
?>

<form method="post" action="media.php">
<input type="text" name="txtmtn" id="txt" >
<input type="submit" name="bttncfg" id="button2" value="Create Fine Group" onClick="window.open('fine group.php', 'win1','width=420,height=320')">

当我点击'bttncfg'按钮时,一个很好的group.php将会打开但是member.php的txtmtn值会丢失..

3 个答案:

答案 0 :(得分:0)

试试这个:

<input type="submit" name="bttncfg" id="button2" value="Create Fine Group" onClick="window.open('fine group.php', 'win1','width=420,height=320'); return false;">

答案 1 :(得分:0)

<input type="submit"....,你需要采取行动,在那里张贴价值。它将是您要发布值的页面名称,在该页面中,您将获得$_POST[' ']

的价值

答案 2 :(得分:0)

更改表单操作并为其指定目标:

<form method="post" action="fine group.php" target="win1">

这样,表单将被发布到新浏览器窗口中的正确页面。