<?php
require_once 'database.php';
?>
<body>
<form method="post" action="regcheck.php" name="register">
<br>
<label for="username">Username: </label>
<br>
<input id="username" class="input_field" type="text" onmouseout="if(this.value==''){this.value='Username...';}" onclick="javascript:void(0);if(this.value=='Username...'){this.value='';}" maxlength="150" value="Username..." size="35" name="user">
<br>
<br>
<label for="password">Password: </label>
<br>
<input id="password" class="input_field" type="password" onmouseout="if(this.value==''){this.value='Password...';}" onclick="javascript:void(0);if(this.value=='Password...'){this.value='';}" maxlength="100" value="Password..." size="35" name="pass">
<br>
<br>
<label for="email">Email: </label>
<br>
<input id="email" class="input_field" type="email" onmouseout="if(this.value==''){this.value='Email...';}" onclick="javascript:void(0);if(this.value=='Email...'){this.value='';}" maxlength="100" value="Email..." size="35" name="email">
<br />
<br />
<input id="search_btn" type="submit" value="Continue" >
<b>I agree to the Terms & Conditions.</b>
<br>
</form>
<?php
if(
isset( $_POST['user'] ) &&
isset( $_POST['pass'] )
isset( $_POST['email'] ))
{
if( strlen( $_POST['user'] ) < 4 )
{
echo "Username Must Be More Than 4 Characters.";
}
elseif( strlen( $_POST['pass'] ) < 4 )
{
echo "Passwrod Must Be More Than 4 Characters.";
}
elseif( strlen( $_POST['email'] ) < 4 )
{
echo "Email must be valid.";
}
elseif( $_POST['pass'] == $_POST['user'] )
{
echo"Username And Password Can Not Be The Same.";
}
else
{
include( 'database.php' );
$username = mysql_real_escape_string( $_POST['user'] );
$password = md5( $_POST['pass'] );
$email = ( $_POST['email'] );
$sqlCheckForDuplicate = "SELECT username FROM user WHERE username = '". $username ."'";
if( mysql_num_rows( mysql_query( $sqlCheckForDuplicate ) ) == 0 )
{
$sqlRegUser = "INSERT INTO
user( username, password, email )
VALUES(
'". $username ."',
'". $password ."',
'". $email ."',
)";
if( !mysql_query( $sqlRegUser ) )
{
echo "You Could Not Register Because Of An Unexpected Error.";
}
else
{
echo "You Are Registered And Can Now Login";
$formUsername = $username;
header ('location: Login.php');
}
}
else
{
echo "The Username You Have Chosen Is Already Being Used By Another User. Please Try Another One.";
$formUsername = $username;
}
}
}
else
{
echo "You Could Not Be Registered Because Of Missing Data.";
}
?>
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.