I am creating a login and signup page. I am using MAMP server and Querious MySQL manager. The name of this code file is "SignUp.php" and I am going nuts for past fews days to find why isn't it executing on the localhost website. It shows blank screen when I run it from netbeans. This SignUp.php is a webpage template. I use netbeans to code this. Please help me how to get this running because I can run login-form as I code it in html file but this is .php file that contains html section too. I tried all the knowledge I could get but I do not know where I am going wrong. When I run this file, it shows blank page - no html section is displaying. Thank you very much for your help.
<html>
<head>
<meta charset="UTF-8">
<title>SignUp</title>
</head>
<body>
<form name=form3 action="SignUp.php" method="post">
<table id ="title">
<tr>
<p><input id="First_Name" name="fname" type="text" placeholder="First Name"></p>
</tr>
<tr>
<p><input id="Last_Name" name="lname" type="text" placeholder="Last Name"></p>
</tr>
<tr>
<p><input id="Email_Id" name ="email" type="text" placeholder="Email-Id"></p>
</tr>
<tr>
<p><input id="Username" name ="username" type="text" placeholder="Username"></p>
</tr>
<tr>
<p><input id="Password" name ="password" type="password" placeholder="Password"></p>
</tr>
<tr>
<p><input id="Confirm_Password" name ="cpassword" type="password" placeholder="Confirm Password"></p>
</tr>
<tr>
<td> </td>
<p><input type="submit" name="submit" value="Sign Up"
</tr>
</table>
</div>
</form>
<?php
include("DB_Connect.php");
if (isset(filter_input(INPUT_POST,'submit')))
{
if(!filter_input(INPUT_POST,'fname') | !filter_input(INPUT_POST,'lname') | !filter_input(INPUT_POST,'email') |
!filter_input(INPUT_POST,'username') | !filter_input(INPUT_POST,'password') | !filter_input(INPUT_POST,'cpassword'))
{
die('You did not complete all of the required fields');
}
}
//check validation email
$check = "SELECT Email_Id FROM Members where Email_Id='".$email."'";
$result1 = mysql_query($connection,$query1);
$numResults = mysql_num_rows($result1);
if(!!filter_var($email, FILTER_VALIDATE_EMAIL))
{
$message = "Invalid email address, please type valid email address";
}
elseif($numResult>=1)
{
$message = $email." Email already exist!!";
}
//checks if the username is in use
if (!get_magic_quotes_gpc())
{
filter_input(INPUT_POST,'username') = addslashes(filter_input(INPUT_POST,'username'));
}
$usercheck = filter_input(INPUT_POST,'username');
$check1 = mysql_query("SELECT Username FROM Members WHERE Username = '$usercheck'");
// if the name given exist error
$check2 = mysql_num_rows($check1);
if ($check2 != 0)
{
die('Sorry, the Username '. filter_input(INPUT_POST, 'username').' is already in use.');
}
//if passwords match
if (filter_input(INPUT_POST, 'password')!= filter_input(INPUT_POST, 'cpassword'));
{
die('Your passwords did not match. ');
}
//encrypt password
filter_input(INPUT_POST,'password') = md5(filter_input(INPUT_POST, 'password'));
if (!get_magic_quotes_gpc())
{
filter_input(INPUT_POST, 'password') = addslashes(filter_input(INPUT_POST, 'password'));
filter_input(INPUT_POST, 'username') = addslashes(filter_input(INPUT_POST, 'username'));
}
//add member
$insert = "INSERT INTO Members (First Name, Last Name, Email-Id, Username, Password, Confirm Password)
VALUES ('".filter_input(INPUT_POST,'fname')."', '".filter_input(INPUT_POST,'lname')."',
'".filter_input(INPUT_POST,'email')."', '".filter_input(INPUT_POST,'username')."',
'".filter_input(INPUT_POST,'password')."','".filter_input(INPUT_POST,'cpassword')."')";
$add_member = mysql_query($insert);
?>
<h1>Registered</h1>
<p>Thank you, you have registered - you may now login</a>.</p>
?>
</body>