Jump to content
Larry Ullman's Book Forums

Awkuzu

Members
  • Posts

    2
  • Joined

  • Last visited

Awkuzu's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Following is my Web host phpMyAdmin detail: MySQL Server: Localhost via UNIX socket Server version: 5.0.92-community Protocol version: 10 User: smarttis@localhost MySQL charset: UTF-8 Unicode (utf8) Web server cpsrvd 11.28.87 MySQL client version: 4.1.22 PHP extension: mysql phpMyAdmin Version information: 3.3.9.2 Following is my part of my registration code: if($fn && $ln && $em && $city && $cty && $ph && $abda && $abmo && $abye && $p && $tq && $ta) { $q = "SELECT email FROM register WHERE email='$em'"; $r = mysqli_query($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: ".mysqli_error($dbc)); if(mysqli_num_rows($r) == 0) { $a = md5(uniqid(rand(), true)); $pass=md5('$p'); $q = "INSERT INTO register(first_name, last_name, middle_name, address, email, phone, sex, city, country, active, dob_day, dob_month, dob_year, pass, question, answer, date_registered) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW())"; $stmt = mysqli_prepare($dbc, $q); mysqli_stmt_bind_param($stmt, 'ssssssssssisisss', $fn, $ln, $mn, $ad, $em, $ph, $sex, $city, $cty, $a, $abda, $abmo, $abye, $pass, $tq, $ta); mysqli_stmt_execute($stmt); if(mysqli_stmt_affected_rows($stmt)==1) { Following is my part of my login code if($e && $p) { $q = "SELECT user_id, first_name, user_level FROM register WHERE (email = '$e' AND pass=md5('$p')) AND active IS NULL"; $r = mysqli_query($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error:".mysqli_error($dbc)); if(@mysqli_num_rows($r) == 1) { Note: I used SHA1() for encryption before changing to MD5() as the problem persisted
  2. I've used the logging in and Logging Out scripts (Chapter 16: Example—User Registration) on my local server and everything worked fine though without activation. Now, I've uploaded the files to a remote server and off course using the activation script. The activation works fine but I can't log in.I defined the 'active' column in the database as NULL. So after activation, I see 'NULL' replace the activation code yet can't log in. what's cooking?
×
×
  • Create New...