I'm having some trouble with a registration code check on my website. The members who sign up need to have a unique registration code which is stored in a mysql database. Getting the array looks something like this:
Here is where I check against the code:Code:$q = "SELECT code FROM control"; $r = mysqli_query ($connect, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($connect)); $_control = mysqli_fetch_array ($r, MYSQLI_ASSOC);
I'm guessing that the POST is only being checked against the first variable in the control array but I could very easily be simply confused. What do you think Dynamic Drive?Code:if ($_control['code'] == $_POST['code']) { $reg = mail("myemail@email.net","new member","New member","New member"); } else { echo '<p class="error">Please enter a valid registration code!</p>'; }



Reply With Quote

Bookmarks