예제 #1
0
파일: db.php 프로젝트: JeffM2501/HackSharp
function DBSetSingleField($keyName, $key, $table, $field, $value)
{
    $query = "UPDATE " . $table . " SET " . $field . "='" . $value . "' WHERE " . $keyName . "='" . $key . "'";
    return DBSet($query);
}
예제 #2
0
     if ($names != FALSE) {
         echo "BAD NAME";
         exit;
     }
     $emails = DBQuery($db, "SELECT UID FROM Users WHERE Email='{$email}'");
     if ($emails != FALSE) {
         echo "BAD EMAIL";
         exit;
     }
     if ($pass1 != $pass2 || !$pass1) {
         echo "BAD PASS";
         exit;
     }
     $hash = mysql_real_escape_string(md5($pass1));
     $authkey = rand();
     if (!DBSet("INSERT INTO Users (Email, Name, PassHash, Verified, AuthKey) VALUES('{$email}', '{$name}', '{$hash}', 0, {$authkey})")) {
         echo "BAD INTERNAL " . mysql_error();
         exit;
     } else {
         echo "OK";
     }
     $mail = "Click to verify http://www.awesomelaser.com/gauth/index.php?action=verify&key={$authkey}{$uid}={$email}";
     mail($email, "Game Auth Verification", $mail);
     exit;
 } else {
     if ($action == "verify") {
         $uid = GetRequest("email");
         $key = GetRequest("key");
         $ids = DBQuery($db, "SELECT UID FROM Users WHERE Email='{$email}'");
         if ($ids == FALSE) {
             echo "invalid uid";