您的位置:首页 > 其它

使用iframe实现无刷新提交表单

2015-07-08 15:34 537 查看
<?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>

<?php  

$user=$_POST['username'];

$pass=$_POST['password'];

if($user=='an'&&$pass=='123')

echo "<script>alert(登录成功....');</script>";  

?>  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: