Hi All...
I'm glad to be in this forum. I'm making a system to connect three applications in one and have a user register page.
The register page sends an email to the user asking activate the account in order to use the system.
I'm having some matters.
First: I encrypt the username and password with base64_encode and decrypt with base64_decode to send it to the email. * when I update the page the username gets its encode chars and change. I can see that on the confirmation page. *
Second: after sending the confirmation email to the user, I destroy the cookies i use to go though the registration process and when user clicks in email confirmation link, i activate the cookies again. But there's an error:
The email is sent but the content of the email no.
I use this code:
$email= $_COOKIE["email"];
$pwd= $_COOKIE['password'];
$user= $_COOKIE['usuario'];
if(isset($_COOKIE['usuario'])){
echo 'Bievenido a la seccion'." --". $user . "<br>";
$secret= 'proyectos'; //Change this to something long and complicated
$username = base64_encode($user);
$password2 = base64_encode($pwd); //Clean this variable first!
$hash = sha1($username.$secret);
$Text = "To Confirm, click here: <a href= 'htttp: mydomain/pruebacookies2/confirmacion.php?username=$username&password=$password2&hash=$hash'>Confirmar usuario</a>";
/* echo $Text; */
}
else{
echo 'Error: Ha accedido a una sección restringida. Vueva a intentarlo';}
and this is the email part:
$headers = "From: Mydomain.com\r\n";
$headers .= "cc: $from\r\n";
//$headers .= "Bcc: sample3.domainname.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers = "MIME-Version: 1.0rn";
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$enviarmail= mail($to, $subject, $message, $headers);
if ($enviarmail)
{
$enviado= true;
}
else{ $enviado= false;
}
Can you help me or telling me where to find an activation by email script?
I don't really know what is wrong...
I need some help, if i don't fix this, my job is hot!
Thanks