0

I wrote a new form of signup. But it's done vice versa what I need. I show code exists if it's in DB and bypass sing-up if there is any. But I need that it shows: "Wrong code" if "sec_code" not found in my DB (created already a list of these codes) and bypass if it exists in DB. Thx. Stuck on this.

    if($_GET['action'] == "save")
    {
            $sec_code    = htmlspecialchars($_POST['sec_code'], ENT_QUOTES, '');
            $yes    = intval($_POST['yes']);


            if(!$sec_code) {
                $error = "<p class=\"er\"></p>";
            } 

            elseif(mysql_num_rows(mysql_query("SELECT skey FROM users WHERE sec_code = '".$sec_code."'"))) {
                $error = "<p class=\"er\">Security code exist!</p>";
Birger Dj
  • 1
  • 1

0 Answers0