dosc9472 2019-06-18 09:20
浏览 92
已采纳

确认短信上的电话预览URL:生成假验证/ PHP

we have a created for a client a web app (PHP) for meeting scheduling.

We send SMS to users in order to confirm their meeting, with a link to click to confirm their meeting.

Most of user have enable website preview in SMS on their phone.

How can I checked that the page is loading from a phone 'sms browser previewer' OR is really clicked / loaded by a human ?

A simple get_browser could not help, because browsers previewers are often the browser of the user... and it's not a bad robot crawling something..

The client's process is : the user click the link received on his phone, the meeting is confirmed.

Any tips ? Can't find any idea how to detect that and prevent 'false validation'.

thanks !

  • 写回答

1条回答 默认 最新

  • douou1872 2019-06-21 16:17
    关注

    Thanks, cookie trick works :

    in wp function :

       function set_new_cookie_conf() {
        setcookie( 'confirm_cookie', 'human', time() + 3600, COOKIEPATH, COOKIE_DOMAIN );
    }
    add_action( 'init', 'set_new_cookie_conf');
    

    in confirm function :

     if(isset($_COOKIE['confirm_cookie'])) {
                   //DO THE JOB
    
                 }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题