jQuery对话框,php表单

我有一个对话框打开页面加载网站。

script type="text/javascript"> $(function() { $('#dialog-message').dialog({ modal: 'true', width: '400' }); });  

这包括:

 

guest.php有一个非常小的表单,由页面本身处理:

  <?php $dbh=mysql_connect //login stuff here if (isset($_POST['submit'])) { if (!$_POST['name'] | !$_POST['email']) { echo"
Error
Please provide your Name and Email Address so we may properly contact you.
"; } else { $age = $_POST['age']; $name = $_POST['name']; $gender = $_POST['gender']; $email = $_POST['email']; $phone = $_POST['phone']; $comments = $_POST['comments']; $query = "INSERT INTO table here (age,name,gender,email,phone,comments) VALUES ('$age','$name','$gender','$email','$phone','$comments')"; mysql_query($query); mysql_close(); $yoursite = "my site here"; $youremail = $email; $subject = "Website Guest Contact Us Form"; $message = "message here"; $email2 = "send to email address"; mail($email2, $subject, $message, "From: $email"); echo"
Thank you for contacting us,
we will respond as soon as we can.
"; } } ?>
Personal Info



Male Female
Comments

问题是,表单操作的路径不起作用,因为此对话框位于站点的index.html页面上,如果我放置绝对路径,它不会处理…

我有这个function在另一个联系我们页面,所以我知道它的工作原理,但机智的对话框,似乎已经难倒我…

我该怎么办?

我认为你最好的(最简单的)赌注实际上是将表单发布到包装页面(thanks.php或者你有什么),而后者又包含了guest.php代码。

你现在得到它的方式,你将你的结果发布到include / guest.php文件,它没有明显的HTML敷料。 听起来你可能期望以某种AJAX-y方式将结果加载到对话框中?

尝试分离代码或使用#in action属性