window.open 弹出页面关闭,父页面刷新 如何实现? 50
我想实现2.php的一个按钮弹出1.php,选择好用户,然后返回2.php,内容随着选择的人员改变代码如下:这是1.php========================...
我想实现2.php的一个按钮弹出1.php,选择好用户,然后返回2.php,内容随着选择的人员改变
代码如下:
这是1.php==============================
<?php
echo "<h3>选择人员</h3>";
echo "<table>";
echo "<tr>";
echo "<th></th>";
echo "<th><nobr>用户工号</nobr></th>";
echo "<th><nobr>用户姓名</nobr></th>";
echo "<th><nobr>用户部门</nobr></th>";
echo "</tr>";
echo "<form method='POST' action='2.php'>";
echo "<tr>";
echo "<td><input style='width:20px;' type='radio' name='user_job_num1' value='000001'></input></td>";
echo "<td><input name='user_job_num' type='text' id='user_job_num' value='000001'/></td>";
echo "<td><input name='user_name' type='text' id='user_name' value='张三'/></td>";
echo "<td><input name='user_department' type='text' id='user_department' value='技术部'/></td>";
echo "</tr>";
echo "<tr><td style='border:0px;'><input style='width:40px;' class='button' type='submit' value='确定'/></td></tr>";;
echo "</form>";
echo "</table>";
?>
这是2.php============================
<?php
$user_job_num = $_POST[user_job_num];
$user_name = $_POST[user_name];
$user_departmentarray = $_POST[user_department];
echo "工号:".$user_job_num."<br>";
echo "姓名:".$user_name."<br>";
echo "部门:".$user_department."<br>";
?>
<script type="text/javascript">
function open_win()
{
window.open("1.php","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=600, height=600")
}
</script>
<input style="width:80px;" class="button" type="button" name="submit" onclick="open_win()" value="选择用户"/> 展开
代码如下:
这是1.php==============================
<?php
echo "<h3>选择人员</h3>";
echo "<table>";
echo "<tr>";
echo "<th></th>";
echo "<th><nobr>用户工号</nobr></th>";
echo "<th><nobr>用户姓名</nobr></th>";
echo "<th><nobr>用户部门</nobr></th>";
echo "</tr>";
echo "<form method='POST' action='2.php'>";
echo "<tr>";
echo "<td><input style='width:20px;' type='radio' name='user_job_num1' value='000001'></input></td>";
echo "<td><input name='user_job_num' type='text' id='user_job_num' value='000001'/></td>";
echo "<td><input name='user_name' type='text' id='user_name' value='张三'/></td>";
echo "<td><input name='user_department' type='text' id='user_department' value='技术部'/></td>";
echo "</tr>";
echo "<tr><td style='border:0px;'><input style='width:40px;' class='button' type='submit' value='确定'/></td></tr>";;
echo "</form>";
echo "</table>";
?>
这是2.php============================
<?php
$user_job_num = $_POST[user_job_num];
$user_name = $_POST[user_name];
$user_departmentarray = $_POST[user_department];
echo "工号:".$user_job_num."<br>";
echo "姓名:".$user_name."<br>";
echo "部门:".$user_department."<br>";
?>
<script type="text/javascript">
function open_win()
{
window.open("1.php","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=600, height=600")
}
</script>
<input style="width:80px;" class="button" type="button" name="submit" onclick="open_win()" value="选择用户"/> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询