我嘗試使用 fatfree 框架來完成驗(yàn)證用戶注冊(cè)。 1. user registers account on: website/register 2. I save the user data including a verification key 3. he gets an email sent to the email he provided 4. the email contains the link (http://website/register/verify.php?vkey=$vkey) for verification 5. user clicks the link and gets sent to website/register/verify.php?vkey=91cb65b234b0b5d67df68e0d7f72ed7e 6. on the website I check if isset a verification key, and 7. get the verification key stored in db and compare it with ?vkey=$vkey 8. if they match, all good, reroute測(cè)試結(jié)果: Not Found HTTP 404 (GET ../register/verify.php?vkey=91cb65b234b0b5d67df68e0d7f72ed7e)我如何在路由中管理它?我嘗試了什么: $f3->route('GET /register/verify/@vkey', 'Controller\UserController->registerverified'); $f3->route('GET /register/verify.php?vkey=', 'Controller\UserController->registerverified');我很困惑,由于參數(shù)顯然是動(dòng)態(tài)的,如何設(shè)置路線?或者有沒有其他方法可以驗(yàn)證注冊(cè)/他來自發(fā)送給他的電子郵件中的正確鏈接?
1 回答

心有法竹
TA貢獻(xiàn)1866條經(jīng)驗(yàn) 獲得超5個(gè)贊
在一些幫助下弄清楚了:
$f3->route('GET /register/verify/@vkey', 'Controller\UserController->registerverified');
然后檢查是否 isset
$params['vkey']
- 1 回答
- 0 關(guān)注
- 128 瀏覽
添加回答
舉報(bào)
0/150
提交
取消