I'm making a registration page on php and I managed to make everything as I planned and I'm now generating new files each time someone registers. However, I would like the password to be showed on SHA256 on the output instead of plain text. I've tried several functions I've seen here on other questions but I didn't manage to do it. Here's my code, I hope you can help me out:
$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:
Aucun commentaire:
Enregistrer un commentaire