lintz
Jul 20th, 2004, 09:01 PM
I'm learning PHP as I go so please bar with me.
I've set up a registration form for our website and everything works fine. I've now added a check to see if the User Name entered is already taken. The problem is if the registration is successful the User Name field comes through blank in the confirmation email. If I take out the check for duplicate User Names the field is not blank.
Can anyone help me out?
Thanks.
//Check if user name is alrady taken.
$query_l = "SELECT * from ebook_users WHERE username = '$uname'";
$l_check = mysql_query($query_l);
$check = mysql_fetch_row($l_check);
if ($uname = $check[5]) {
include 'registration2.php';
exit;
}
// starting registration [sending verification email]
include("mojt_db.php");
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: me@mydoamin.com";
$body = "*****************************************************
<br>
Hi $ufname,
<p>
\n\nTo activate your account please <a href=\"$SiteUrl/$MojtDir/index.php?substr=registration&ufname=$ufname&ulname=$ulname&uemail=$uemail&uicq=$uicq&uwsite=$uwsite&uname=$uname&upass=$upass\">click here</a> to verify your email address.
<p>
Regards,
<p>
\n$SiteName Team.
<br>
*****************************************************";
mail($uemail, "Confirmation Email", $body, $headers);
I've set up a registration form for our website and everything works fine. I've now added a check to see if the User Name entered is already taken. The problem is if the registration is successful the User Name field comes through blank in the confirmation email. If I take out the check for duplicate User Names the field is not blank.
Can anyone help me out?
Thanks.
//Check if user name is alrady taken.
$query_l = "SELECT * from ebook_users WHERE username = '$uname'";
$l_check = mysql_query($query_l);
$check = mysql_fetch_row($l_check);
if ($uname = $check[5]) {
include 'registration2.php';
exit;
}
// starting registration [sending verification email]
include("mojt_db.php");
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: me@mydoamin.com";
$body = "*****************************************************
<br>
Hi $ufname,
<p>
\n\nTo activate your account please <a href=\"$SiteUrl/$MojtDir/index.php?substr=registration&ufname=$ufname&ulname=$ulname&uemail=$uemail&uicq=$uicq&uwsite=$uwsite&uname=$uname&upass=$upass\">click here</a> to verify your email address.
<p>
Regards,
<p>
\n$SiteName Team.
<br>
*****************************************************";
mail($uemail, "Confirmation Email", $body, $headers);