yo, i'm using a signup form for my users. They can create a new account and also get the confirmation mail with activation link within.
When they click on activation link they go automatically to my page and get message about account is activated.
Problem: The account won't get activated - they can't login and in sql database they are not activated.
So i've checked the 'emailverified.php' cause it's included in each activation link.
Unfortunatly i had to mention, this file isn't utf8 converted.
Does somebody know if this could be the reason for?
If yes, please tell me how to do this simple. Here you get the beginning of code from 'emailverified.php':
include('include/header.php');
include('phpmailer/class.phpmailer.php');
if(isset($_GET["ID"]) && isset($_GET["PID"])) {
$email=stripslashes(base64_decode($_GET["ID"]));
$password=stripslashes($_GET["PID"]);
if(isset($_GET["active"])) {
$active=$_GET["active"];
} else { +++++
Thanks in advance.
Data in Link: http://www.my-url.com/emailverified.php?ID=Y2Fwb25lQG91dGxvb2suZGU=&PID=Y2Fwb25lcw==&active=yes
db query (php sending)
$rec = dbQuery("select * from user_registration
where email
='$email'");
if(dbNumRows($rec)>0) {
echo 'yes';
}
else {
echo 'no';
}
}
else {
echo 'no';
}
//
I really think it's cause the .php file isn't utf8 and is not writing it to database. please help me to do it utf8 first - if it isn't working then i will check the code.
first signup.php
then i think: emailcheck.php
if(isset($_GET["email"]) && $_GET["email"]!='') {
$email=strtolower($_GET["email"]);
$rec = dbQuery("select * from `user_registration` where `email`='$email'");
if(dbNumRows($rec)>0) {
echo 'yes';
}
else {
echo 'no';
}
}
else {
echo 'no';
}
receiving activation link click on: http://www.my-url.com/emailverified.php?ID=Y2Fwb25lQG91dGxvb2suZGU=&PID=Y2Fwb25lcw==&active=yes
then emailverified.php
if(isset($_GET["ID"]) && isset($_GET["PID"])) {
$email=stripslashes(base64_decode($_GET["ID"]));
$password=stripslashes($_GET["PID"]);
if(isset($_GET["active"])) {
$active=$_GET["active"];
} else {
$active='';
}
$s = dbQuery("select * from `user_registration` where `email`='".$email."' and `password`='".$password."'");
if(dbNumRows($s)>0 && $active=="yes") {
$arr=explode(" ", date("Y-m-d H:i:s"));
$ar1=explode("-", $arr[0]);
$ar2=explode(":", $arr[1]);
$_SESSION["userlogin"]=$email;
$a = dbQuery("select * from `user_registration` where `email`='".$email."' and `password`='".$password."' and `createdate`<'".date("Y-m-d",mktime($ar2[0], $ar2[1], $ar2[2], $ar1[1], $ar1[2]-1, $ar1[0]))."'");
if(dbNumRows($a)==0) {
dbQuery("update `user_registration` set `status`='1',`current_balance`='".$SignUpbonus."' where `email`='".$email."' and `password`='".$password."'");
dbQuery("insert into `myaccount`(`email`,`amount`,`type`,`createdate`) values('".$email."','".$SignUpbonus."','1','".$totaldate."')");
$d='';
$sig = dbFetchArray(dbQuery("select * from `mailsettings` where `id`='13'"),MYSQL_BOTH);
$user = dbFetchArray(dbQuery("select * from `user_registration` where `email`='".$email."'"),MYSQL_BOTH);
$benefitusersql=dbQuery("select * from `user_registration` where `email`='".$user["referrer"]."'");
if(dbNumRows($benefitusersql)>0) {
$benefituserres=dbFetchArray($benefitusersql,MYSQL_BOTH);
dbQuery("update `user_registration` set `bonuscount`='".($benefituserres["bonuscount"]+1)."' where `email`='".$user["referrer"]."'");
}
$Subject1 = stripslashes($sig["subject"]);
$TemplateMessage=str_replace("%FULLNAME%", $user["fullname"], stripslashes($sig["message"]));
$TemplateMessage=str_replace("%EMAIL%", $user["email"], $TemplateMessage);
$TemplateMessage=str_replace("%PASSWORD%", base64_decode($user["password"]), $TemplateMessage);
$mail1 = new PHPMailer;
$mail1->FromName = $fromName;
$mail1->From = $from;
$mail1->Subject = $Subject1;
$mail1->Body = stripslashes($TemplateMessage);
$mail1->AltBody = stripslashes($TemplateMessage);
$mail1->IsHTML(true);
$mail1->AddAddress($user["email"],$fromName);
$mail1->Send();
$TemplateMessage="Hi ";
$TemplateMessage.="<br><br>";
$TemplateMessage.="A new account has been created.<br>";
$TemplateMessage.="Please login to the admin control panel to view details:<br>";
$TemplateMessage.="<br>----------------<br><br>";
$TemplateMessage.="User's Email: ".$user["email"]."<br><br>";
$TemplateMessage.="Thanks,<br>";
$TemplateMessage.=$fromName."<br>";
$TemplateMessage.=$SiteName."<br>"; +++++
SOLVED
just exchanged the active=yes to active=1