Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
基于SHA256的PHP密码输出_Php_Web_Registration - Fatal编程技术网

基于SHA256的PHP密码输出

基于SHA256的PHP密码输出,php,web,registration,Php,Web,Registration,我在php上创建了一个注册页面,我按照计划完成了所有工作,现在每当有人注册时,我都会生成新文件。但是,我希望在输出的SHA256上显示密码,而不是纯文本。我在其他问题上尝试了几个函数,但都没有成功。这是我的代码,希望你能帮我: $file = scandir($this->path_accounts); $UID = count($file)+999998; $Data = '<?xml version="1.0" encoding="utf-8"?>'.EL; $Data

我在php上创建了一个注册页面,我按照计划完成了所有工作,现在每当有人注册时,我都会生成新文件。但是,我希望在输出的SHA256上显示密码,而不是纯文本。我在其他问题上尝试了几个函数,但都没有成功。这是我的代码,希望你能帮我:

$file = scandir($this->path_accounts);
$UID = count($file)+999998;

$Data  = '<?xml version="1.0" encoding="utf-8"?>'.EL;
$Data .= "<Account>".EL;
$Data .= '  <section name="Informations">'.EL;
$Data .= '    <entry name="AccountID">'.$this->username.'</entry>'.EL;
$Data .= '    <entry name="Password">'.$this->+password."</entry>".EL;
$Data .= '    <entry name="RealName">'.$this->realname."</entry>".EL;
$Data .= '    <entry name="Email">'.$this->email."</entry>".EL;
$Data .= '    <entry name="Question">'.$this->question."</entry>".EL;
$Data .= '    <entry name="Answer">'.$this->answer."</entry>".EL;
$Data .= '    <entry name="Creation">Mon, 21 Dec 2015 19:24:17 GMT</entry>'.EL;
$Data .= "  </section>".EL;
$Data .= "</Account>".EL;

file_put_contents($this->fullpath, $Data);

if(file_exists($this->fullpath)):
    echo $this->message('Thank you for registering.');
else:
$file=scandir($this->path\u accounts);
$UID=count($file)+99998;
$Data=''.EL;
$Data.=.EL;
$Data.=''.EL;
$Data.=''.$this->username'.'.EL;
$Data.=''.$this->+密码.EL;
$Data.=''.$this->realname.'.EL;
$Data.=''.$this->email.'.EL;
$Data.=''.$this->question.“.EL;
$Data.=''.$this->answer.“.EL;
$Data.='2015年12月21日星期一19:24:17 GMT'.EL;
$Data.=.EL;
$Data.=.EL;
文件内容($this->fullpath,$Data);
如果(文件_存在($this->fullpath)):
echo$this->message('谢谢注册');
其他:
您可以使用该功能

$Data.=''。散列('sha256',$this->password)。“”.EL
$Data .= '<entry name="Password">'. hash('sha256', $this->password) ."</entry>".EL