//create variable to store data $user=$_POST['user']; $password1=$_POST['password1']; $password2=$_POST['password2']; $email=$_POST['email']; $phone=$_POST['phone']; $company=$_POST['company']; $address=$_POST['address'];
// CEK IF DATA NOT EMPTY
//cek if password anda retype password in same if($password1!=$password2){ echo '<h2>Password and Retype Password must be in same!</h2>';
}else{ //save data to database // creating query $query="INSERT INTO user_login (user, password, email, phone, address) VALUES ('$user', '$password1', '$email', '$phone', '$address' )";
$result=@mysql_query($query)or die(mysql_error()); if($result){ echo '<h2>Registration Success</h2><br><a href="index.php">Continue Login</a>'; }else{ echo '<h2>Error!! Can not save data to database!</h2>'; } }
Posting Komentar