关于jquery对话框

时间:2014-01-16 00:56:37

标签: javascript php jquery

如何将此代码放入我的程序中的注册码中,如果注册成功,这会弹出?我是jquery的新手,所以我不知道如何做这些事情......请帮助我们。

<script>
$(document).ready(function() {
    // show a dialog box when clicking on a link
    $("#press").on('click', function(e) {
        e.preventDefault();
    $.Zebra_Dialog('<strong>Congratulations </strong>' + 
    'You are now successfully registered!');
    });
 });
</script>

这是我的PHP代码:

<?php 

if(isset($_POST['save']))
{
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$position = $_POST['position'];
$username = $_POST['username'];
$password = $_POST['password'];
$dateregistered = date("Y-m-d H:i:s");
if (!$_POST['fname'] || !$_POST['lname'] || !$_POST['position'] || !$_POST['username'] || !$_POST['password'] ) 
{
echo "You did not complete all of the required fields!";
}
else
{
$query="INSERT INTO users (position, fname, lname, username,password,dateregistered) VALUES ('$position','$fname','$lname','$username','$password',CURRENT_TIMESTAMP) ";
mysql_query($query);
if($query){
echo "You Successfully Created an Account!";
}
}
}
?>

0 个答案:

没有答案