Advanced DHTML Popup
http://www.dpopup.com/dhtml-popup-examples.html
I am using there pop up script to display a form , very similar to what they have on the page above where it pops up on the bottom.
When I submit the form I want it to post the data to the DB but also stay on that same window and say thank you , blah blah you can now close this window.
But its not going that, How can I do it how they have it on their thing ? where when you hit submit it loads on that same pop up window.
PS. I also tried to close on submit but that does not work
Thanks for the help
HTML Code:
<form method="post" action="register2.php" onsubmit="top.close();">
Name<br/><input type="text" name="name" maxlength="20" /><br/>
Email<br/><input type="text" name="email" /><br/>
<input name="submit" input type="submit" value="Submit Me" />
</form>
My PHP
PHP Code:
<?PHP
// register2.php
include("dbconnect.php");
$errors = "";
if (!isset($_POST['name']))
$errors .= "Please provide your name. <br/>";
if (!isset($_POST['email']))
$errors .= "Please provide an email address. <br/>";
if ($errors == "") {
mysql_query("INSERT INTO user_list VALUES(
'',
'".addslashes($_POST['name'])."',
'".addslashes($_POST['email'])."',
'".time()."'
)") or die(mysql_error());
echo "Registration Successful!";
} else {
echo $errors."Please go back and try again.";
}
?>
|