不刷新提交表单

时间:2014-05-09 03:42:09   收藏:0   阅读:288

先看一段代码(PHP例子)

1、表单代码(form.php):

[php] view plaincopy

<?php  
header("Content-type: text/html; charset=utf8");  
?>  
<iframe name="testIframeName" style="display:none;"></iframe>  
<form target="testIframeName" method="post" action="formAction.php">  
<input type="text" name="username"/>  
<input type="password" name="password"/>  
<input type="submit" value=" 提 交 " />  
</form>  

2、action代码(formAction.php):

[php] view plaincopy

<?php  
echo "<script>alert(‘test....‘);</script>";  
?>  

不刷新提交表单,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!