register.php
register.php
<?php
if($_POST["password"]==$_POST["cpassword"])
{
$con=mysqli_connect("localhost","63327-10162995","123","63327-10162995");
if(mysqli_connect_errno())
{
echo"Failed to connect to MySQL:".mysqli_connect_error();
}
$sql="INSERT INTO user(username,password,email,gender,fname,lname)VALUES ('$_POST[username]','$_POST[password]','$_POST[email]','$_POST[gender]','$_POST[fname]','$_POST[lname]')";
if(!mysqli_query($con,$sql))
{
die("Error:".mysqli_error());
}
echo"<script type='text/javascript'>
window.alert('You Have Successfully\ Registered a New Account!');
document.write('<?php header('Location:http:lab203/63327/63327-10162995/Desktop/Dequit/Midterm/MAct1_Dequit.html');?>')
</script>";
mysqli_close($con);
}
else
{
echo"<script type='text/javascript'>
window.alert('Password does not match!');
</script>";
}
?>
<?php
if