第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

加密登錄密碼

加密登錄密碼

有人可以看到我的代碼有什么問題嗎?當(dāng)我嘗試登錄時,它無法識別密碼。我有非常相似的 admin 代碼,它正在工作,但這個不是。function register_client(){  if(isset($_POST['register'])){    $client_name     = escape_string($_POST['client_name']);    $client_surname  = escape_string($_POST['client_surname']);    $client_email    = escape_string($_POST['client_email']);    $client_phone    = escape_string($_POST['client_phone']);    $client_password = escape_string($_POST['client_password']);    $country         = escape_string($_POST['country']);    $city            = escape_string($_POST['city']);    $zip_code        = escape_string($_POST['zip_code']);    $client_address  = escape_string($_POST['client_address']);    $client_password = password_hash($password, PASSWORD_BCRYPT, array('cost' =>10));    $get_query = query("SELECT client_email FROM client_db");    confirm($get_query);    $tem = 0;    while($row = fetch_array($get_query)){    $check_mail = $row['client_email'];      if($client_email === $check_mail){        $tem++;      }    }    if($tem === 0){      $query = query("INSERT INTO client_db(client_name, client_surname, client_email, client_password, client_phone, country, city, zip_code, client_address) VALUES('{$client_name}', '{$client_surname}', '{$client_email}', '{$client_password}',  '{$client_phone}', '{$country}', '{$city}', '{$zip_code}', '{$client_address}') ");      confirm($query);      redirect("client_login.php");    }else{      set_message("incorrect email address");    }  }}function login_client(){  if(isset($_POST['submit_client'])){    $user_email = escape_string($_POST['client_email']);    $password = escape_string($_POST['client_password']);    $query = query("SELECT * FROM client_db WHERE client_email = '{$user_email}' ");    confirm($query);    while($row = fetch_array($query)){    $db_password = $row['client_password'];    $client_id = $row['client_id'];}      if(password_verify($password, $db_password)){      $_SESSION['user_login'] = $client_id;      redirect("index.php?id={$client_id}");    }
查看完整描述

1 回答

?
LEATH

TA貢獻(xiàn)1936條經(jīng)驗(yàn) 獲得超7個贊

也許這一行是錯誤的,因?yàn)?$password 在這里是未知的:

$client_password = password_hash($password, PASSWORD_BCRYPT, array('cost' =>10));

應(yīng)該:

$client_password = password_hash($client_password, PASSWORD_BCRYPT, array('cost' =>10));


查看完整回答
反對 回復(fù) 2021-12-24
  • 1 回答
  • 0 關(guān)注
  • 157 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號