douqun1977 2017-05-05 08:35
浏览 78

在电子邮件中使用POST方法表单?

I send emails to my clients with an "Answer survey" link, and I'm not sure what HTTP method to use to add the user's email to each link, my options are to use the email as a GET parameter in the URL or to add a form to the email with the user's email as a POST parameter.

What is the pros/cons of each ? and what is the best way to accomplish this? I'm concerned about security.

  • 写回答

1条回答 默认 最新

  • dqpciw9742 2017-05-05 08:46
    关注

    You cannot post post in email also javascript will not run email client , the best why is to make the secure email link for that you need to encrypt the email and put that in link

    like that http://{link-to-surveypage}/{encrypt-email}

    on that page you decrypt that and get the user email in safe and secure why here is the function you can use

    <?php
    function encrypt_decrypt($action, $string)
    {
        $output = false;
    
        $key = 'P0Qst@163!#';
    
        // initialization vector 
        $iv = md5(md5($key));
    
        if ($action == 'encrypt') {
            $output = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, $iv);
            $output = base64_encode($output);
        } else {
            if ($action == 'decrypt') {
                $output = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, $iv);
                $output = rtrim($output, "");
            }
        }
        return $output;
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)