} } } } // Check if the form has been submitted. if (isset($_POST['hidden'])) { // our form has been submitted. $serial_u = $_POST['serial1'] . "-" . $_POST['serial2'] . "-" . $_POST['serial3'] . "-" . $_POST['serial4'] . "-" . $_POST['serial5']; $serial = mysql_real_escape_string($serial_u); if ($serial == "----") { $error = "Serial is missing."; } else { $check = mysql_query("SELECT * FROM licences WHERE serial = '" . $serial . "'"); if (mysql_num_rows($check) == 0) { // serial is invalid. Add to bans. $bans->addStrike($_SERVER['REMOTE_ADDR']); $error = "Serial is invalid."; } else { // the serial came back valid. $serialData = mysql_fetch_assoc($check); if ($serialData['user'] != "") { // the serial is already used. $error = "Serial has already been activated."; } else { // the serial is still active. // set the variable user details true $getData = true; } } } }