How do I make a link sent by mail and made by random tokens access their own data in a PHP page

前端 未结 1 2024
执笔经年
执笔经年 2021-01-29 07:21

I have a token that I have created randomly in PHP. I created this token to be able to send it via mail to the intended user. After the link is made what I don\'t know is how I

相关标签:
1条回答
  • 2021-01-29 07:59

    You said you have token in database, so pseudocode is here:

    In example.com/polls/token

    $tokenString = $_GET['token'];
    $tokenModel = FindTokenFromDatabase('token');
    //All other code to generate token specific content
    

    You probably want to link token to your user in your database. Also note that /polls/token only works if you have correctly setup pretty links in your webserver, if you dont have it setup you should use:

    example.com/polls?token=token

    There is no universal code in here.

    0 讨论(0)
提交回复
热议问题