tinkphp登入驗證碼的使用

2022-08-16 22:15:15 字數 582 閱讀 6804

登入和驗證(控制器)

<?php

namespace come\controller;

use think\controller;

class rencontroller extends controller

// 組合查詢條件

$where = array();

$where['uid'] = $data['uid'];//取輸入的使用者名稱

$result = $users->where($where)->field('uid,pwd')->find();

// 驗證使用者名稱 密碼

if ($data['uid'] == $result['uid']) //判斷使用者名稱是否正確

else

}else

} else

} else

}* 驗證碼

*/public function verify()

登入頁面:

請使用賬號和密碼登入

//判斷使用者名稱是否正確

登入驗證碼

生成驗證碼 指定驗證碼的長度 public static string createvalidatecode int length 生成隨機數字 for int i 0 i length i 抽取隨機數字 for int i 0 i length i 生成驗證碼 for int i 0 i leng...

登入驗證碼C

一.新建乙個checkcode.aspx using system using system.data using system.configuration using system.collections using system.web using system.web.security usi...

註冊登入驗證碼

1 判斷是不是手機號 public boolean ismobileno string mobiles matcher m p.matcher mobiles return m.matches 2 判斷密碼格式是否正確 public boolean iscorrectpassword string ...