Hello,
I'm new at this forum.The problem is that my footer is gone when i click the submit botton because of the die function in my php script. I want it to prompt for empty fields and if not empty, it will insert values into my database. I found prompt empty field code in this website and use it to mine, and that's the time that problem occurs.
This is the code:
<?php
if(isset($_POST['signup'])){
if(empty($_POST['name']) && empty($_POST['email'])) {
die('<div id="error"><img src="img/wrong.png" width="25px"height="17px"/>Name and email field was empty</div>');
}
if(empty($_POST['name'])) {
die('<div id="error"><img src="img/wrong.png" width="25px"height="17px"/>Name field was empty</div>');
}
if(empty($_POST['email'])) {
die('<div id="error"><img src="img/wrong.png" width="25px"height="17px"/>Email field was empty</div>');
}
if(empty($_POST['pass'])) {
die('<div id="error"><img src="img/wrong.png" width="25px"height="17px"/>Password field was empty</div>');
}
if($_POST['cpass'] == $_POST['pass']){
$query = mysql_query("INSERT INTO members(name,email,password) values('{$_POST['name']}','{$_POST['email']}','{$_POST['pass']}')");
if($query){
echo '<div id="good"><img src="img/right.png" width="25px"height="17px"/>Successful</div>';
}
else{
echo '<div id="error"><img src="img/wrong.png" width="25px"height="17px"/>Invalid! Sign Up Again</div>';
}
}
else{
echo '<div id="error"><img src="img/wrong.png" width="25px"height="17px"/>Password did not match</div>';
}
}
mysql_close();
?>
Please help me through this. and sorry for my bad english. Hoping for your quick reply.