English 中文(简体)
我应如何确定这一点? 纽约总部
原标题:How should I fix this? Symbols in $_GET

对于我的电子邮件确认书,我通过我现有的单向加密功能操作用户电子邮件地址,然后从中选取20个特性,产生了一个信号。 我从用户处获得启示,作为“GET”变量或“POST”变量。 当进入电子邮件地址时,该地址有附加标记(+),然后被用户收回,作为“GET变量”,加标被转换成一个空间和散列变化,则以斜线比照。

因此,我想知道,围绕这一点开展工作的最佳方式是什么? 替罪羊加标志吗? 更改加标? URL encode it? 当我使用“GET”美元时,会发生什么其他特点?

这里是相关的法典,如果它有助于:

<?php
if (isset ($_GET[ email ], $_GET[ token ])) {
    $email = strtolower (mysql_real_escape_string($_GET[ email ]));
    $token = mysql_real_escape_string($_GET[ token ]);
    $correctToken = substr (doEncrypt ($email), -26, -6);
}elseif (isset ($_POST[ submit ])) {
    $email = strtolower (mysql_real_escape_string($_POST[ email ]));
    $token = mysql_real_escape_string($_POST[ token ]);
    $correctToken = substr (doEncrypt ($email), -26, -6);
}

if (isset ($email, $token, $correctToken)){    
    if ($token == $correctToken) {
        // Confirm user s email!
    }
}
?>

Thank you very much! Billy

EDIT:科索沃是目前最大的问题,它是否表示在用美元检索时将空间转化为空间的唯一特性? 如果是的话,那么我只可以在_GET款下添加这一句子:$email = str_replace(+ , 电子邮箱:。 没有任何其他理由将空间放在电子邮件地址之内?

Thanks again, Billy

最佳回答

如果是我的话,我将做一个str_replace(),以便在洗.之前将附加标志改为空间。 规定<代码>str_replace(>)功能之内;这样,用户的电子邮件地址只能在功能范围范围内修改,其余部分则保持不变。

function hash_email($email)
{
  $email = str_replace( + ,    , $email);

  ...hashing stuff happens here...

  return $token;
}

$token = hash_email($_GET[ email ]);
问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签