我是新的模态覆盖,并有一个模式php如下所示:
<div id="MessageBox" class="modalMessageBox">
<?php start-session() ?>
<div>
<a title="Close" class="close" href="#close" >X</a>
<h2><?php $_SESSION['MessageBox_Title']; ?></h2>
<br><br>
<p><?php $_SESSION['MessageBox_Error']; ?></p>
<br><br>
<button type="button" onclick="#openLogin">Yes</button>
<button type="button" onclick="index.php">no</button>
</div>
</div>现在,我需要在将数据插入数据库后通过控制,以表明插入成功。我能够将控制从href属性上的'a‘标记传递到一个模态窗口(例如这里),但需要用户的干预。我想做的是:
<pre><?php
session_start();
/**
* Created by PhpStorm.
* User: developer
* Date: 4/18/14
* Time: 10:46 AM
*/
include_once './dha_datamgr.php';
include_once './regform.php';
/* Load Registration Record */
if (SubmitRegistration()) {
/* enter server side code to redirect to #MessageBox if everything went okay. */
}else{
$hdr = 'location:../registration.php';
header($hdr);
}
?>这里是我用来帮助我的模态对话框(http://www.webdesignerdepot.com/2012/10/creating-a-modal-window-with-html5-and-css3/)建模的站点。
发布于 2014-04-28 04:58:59
据我所知,如果提交的注册失败,您希望显示错误对话框消息。
您应该理解PHP是服务器端编程,javascript是客户端编程。从您想要创建的是客户端事件提交注册表单后,弹出一个错误对话框会显示正确吗?
我建议在提交表单时使用jQuery.post,如果php服务器未能在对话框中显示错误消息,则获得php服务器响应。
https://stackoverflow.com/questions/23332246
复制相似问题