mardi 3 mars 2015

I cannot somehow POST files on my database

Im trying to make my school project and would like to make a login system and registration system...my login queries are fine but my registration is taking its time...ivev been here for 3-4 hours trying to figure this out im crying right now.... ive done everything....so in my desperate need i asked this community... please provide immediate answers i desperately need it... the problem is... i cannot seem to haul in the data that i type into my form...tahts it...i dont know whats the reason behind



if($_POST['registerbtn'])
{
$getuser = $_POST['user'];
$getemail = $_POST['email'];
$getpass = $_POST['pass'];
$getconfirmation = $_POST['confirmation'];

if($getemail){


if($getuser){

if($getpass){

if($getconfirmation){

if( $getpass === $getconfirmation ){
if( (strlen($getemail) >= 7) && (strstr($getemail, "@")) && (strstr($getemail, "."))) {

require("./Connect.php");

$query = mysql_query("SELECT * FROM users WHERE username='$getuser'");
$numrows = mysql_num_rows($query);

if($numrows == 0){
$query = mysql_query("SELECT * FROM users WHERE email='$getemail'");
$numrows = mysql_num_rows($query);

if($numrows == 0){

$date = date("F d, Y");
$code = rand();

mysql_query("INSERT INTO users VALUES('', '$getuser', '$getemail', '$getpass', '$date' )");
mysql_query("SELECT * FROM users WHERE username='$getuser'");
$numrows = mysql_num_rows($query);

if($numrows == 1){



}else
$errormsg = "An Error Has Occurred. Account Not Processed";


}else
$errormsg ="There is already a user with that email.";


}else
$errormsg ="There is already a user with that username.";


mysql_close();

}else
$errormsg = "You must enter a valid email address";

}else
$errormsg = "Your passwords did not match";


}else
$errormsg = "Confirm your password";
}else
$errormsg = "You must enter your password";
}else
$errormsg = "You must enter your username";



}else
$errormsg = "You must enter your email address";

}





$form = "<form action='./register.php' method='post'>

<table>
<tr>
<td></td>
<td><font color='red'>$errormsg</font></td>
</tr>
</table>
<fieldset>
<legend>Account</legend>
<input type='text' name='user' size='15' value='$getuser'/>:Username<br/>
<input type='text' name='email' size='15'value='$getemail'>:Email<br/>
<input type='password' name='pass' size='15' value=''/>:Passcode<br/>
<input type='password' name='confirmation' size='15' value=''/>:Confirmation<br/>
<br/>
<input type='submit' name='registerbtn' value='EAT ME'/>
</fieldset>
</form>";
echo "$form";
?>

Aucun commentaire:

Enregistrer un commentaire