runnerjp Posted May 17, 2007 Share Posted May 17, 2007 i have the script where and email is sent with $url = 'http://www.runnerselite.com/activate.php?hash='.md5($password).'&stamp='.base64_encode($time); and on the account page it says UPDATE users SET status = 1 WHERE (password = "'.md5($_GET['hash']).'") AND (timestamp = '.base64_decode($_GET['time'].') but the problem is do i have to set the script to say status 0 in the registration if so how do i do it and where do i put it ? Link to comment https://forums.phpfreaks.com/topic/51814-solved-adding-status-0-and-1-when-users-activate/ Share on other sites More sharing options...
runnerjp Posted May 17, 2007 Author Share Posted May 17, 2007 /** * addNewUser - Inserts the given (username, password, email) * info into the database. Appropriate user level is set. * Returns true on success, false otherwise. */ function addNewUser($username, $password, $email){ $time = time(); /* If admin sign up, give admin user level */ if(strcasecmp($username, ADMIN_NAME) == 0){ $ulevel = ADMIN_LEVEL; }else{ $ulevel = USER_LEVEL; } $q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', $time)"; return mysql_query($q, $this->connection); } /** * updateUserField - Updates a field, specified by the field * parameter, in the user's row of the database. */ function updateUserField($username, $field, $value){ $q = "UPDATE ".TBL_USERS." SET ".$field." = '$value' WHERE username = '$username'"; return mysql_query($q, $this->connection); Link to comment https://forums.phpfreaks.com/topic/51814-solved-adding-status-0-and-1-when-users-activate/#findComment-255287 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.