KattMama Posted November 15, 2006 Share Posted November 15, 2006 I'm a newb but a quick learner so I'm hoping someone can help me.I want to enter the serial numbers from my product into a database, then allow customers access to a hidden part of the website when they register using one of these serial numbers. I've been able to get the form to check the serial number against the database and give an error if the serial number doesn't exist, but when it does exist, I can't get it to append the rest of the users information to the record. It doesn't seem like it's even processing the rest of the form (which works fine when I take out the part about checking the sernum). At this point, I wouldn't even mind if it created a new record (although I have the sernum as the primary key so I guess I would need to change the database layout first). Any help appreciated!!Here's what I have:[code]<?if(isset($todo) and $todo=="post"){$status = "OK";$msg="";if(mysql_num_rows(mysql_query("SELECT sernum FROM 1_signup WHERE sernum = '$sernum'")))$status= "OK";else{$msg=$msg."Serial number not found in our database. Please try again or contact your sales representative.<BR>";$status= "NOTOK";}if(mysql_num_rows(mysql_query("SELECT email FROM 1_signup WHERE email = '$email'"))){$msg=$msg."Email already exists. Please try another one<BR>";$status= "NOTOK";}if ( strlen($password) < 3 ){$msg=$msg."Password must be more than 3 char length<BR>";$status= "NOTOK";} if ( $password <> $password2 ){$msg=$msg."Both passwords are not matching<BR>";$status= "NOTOK";}if ( strlen($sernum) < 1 ){$msg=$msg."You must enter your Serial Number<BR>";$status= "NOTOK";}if ($agree<>"yes") {$msg=$msg."You must agree to terms and conditions<BR>";$status= "NOTOK";}if($status<>"OK"){ echo "<font face='Verdana' size='2' color=red>$msg</font><br><input type='button' value='Retry' onClick='history.go(-1)'>";}else{ $query=mysql_query("insert into 1_signup(email,password,name,sernum) values('$email','$password','$name','$sernum')");echo "<font face='Verdana' size='2' color=green>Welcome, You have successfully signed up<br><br><a href=login.php>Click here to login</a><br></font>";}}?>[/code] Quote Link to comment Share on other sites More sharing options...
fenway Posted November 15, 2006 Share Posted November 15, 2006 I'm not sure what you mean by "append" -- I don't see an UPDATE statement anywhere. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.