Congratulations on the tutorial man,its very good.
The thing is that I tried to use the email verification part into hall's reguser.php script and it worked well(after registering I was able to recieve the verification email) but it had a small problem...in the verification link the id didnt appear but only the pass ,so it was something like :
http://www.worldofbattle.co.cc/activati ... d52ed113dc ....so there is no id number,I've checked the code numerous times but had no ideea where the problem is.
I'll post the reguser.php code :
Code: Select all
<?php
include_once 'connect.php';
if(!isset($_SESSION['id'])){
if(isset($_COOKIE['idCookie'])){
$id = $_COOKIE['idCookie'];
$_SESSION['id'] = $id;
header("Location: http://www.netrixnetwork.com/centralCommand.php");
exit();
}
}else if(isset($_SESSION['id'])){
header("Location: http://www.netrixnetwork.com/centralCommand.php");
exit();
}
$player=$_POST['player'];
$password=$_POST['password'];
$pass2=$_POST['pass2'];
$player=strip_tags($player);
$email=$_POST['email'];
$email=strip_tags($email);
$classchoice=$_POST['classchoice'];
if ($email == "")
{
echo "You didn't enter a email address!<br>";
echo " <A href='register.php'>Go back</a>";
exit;
}
if ($password==$pass2)
{
$isplayer="SELECT * from players where name='$player'";
$isplayer2=mysql_query($isplayer) or die("Could not query players table");
$isplayer3=mysql_fetch_array($isplayer2);
if(!$_POST['password'] || !$_POST['pass2'])
{
print "You did not enter a password<br>";
echo " <A href='register.php'>Go back</a>";
exit;
}
else if($isplayer3 || strlen($player)>21 || strlen($player)<1)
{
print "There is already a player of that name or the name you specified is over 16 letters or less than 1 letter";
echo " <A href='register.php'>Go back</a><br>";
exit;
}
else
{
$isaddress="SELECT * from players where email='$email'";
$isaddress2=mysql_query($isaddress) or die("not able to query for password");
$isaddress3=mysql_fetch_array($isaddress2);
if($isaddress3)
{
print "There is already a player with that e-mail address";
echo " <A href='register.php'>Go back</a><br>";
exit;
}
else
{
$password=md5($password);
$classquery="SELECT * from classes where name='$classchoice'";
$classquery2=mysql_query($classquery) or die("Could not query classes");
$classquery3=mysql_fetch_array($classquery2);
$SQL = "INSERT into players(id, name, password, email, level, exper, attack, defense, hpoints, maxhp, spoints, maxspoints,pclass,gold,sign_up_date) VALUES ('$id','$player','$password','$email','1','0','$classquery3[attack]','$classquery3[defense]','$classquery3[hpoints]','$classquery3[hpoints]','$classquery3[spoints]','$classquery3[spoints]','$classquery3[name]','100',now())";
mysql_query($SQL) or die("could not register");
print "Thank you for registering!";
$to = "$email";
$from = "admin@worldofbattle.co.cc";
$subject = "Complete World of Battle registration";
//Begin HTML Email Message
$message = "Hi $player,
Complete this step to activate your login identity at World of Battle.
Click the line below to activate when ready.
http://www.worldofbattle.co.cc/activation.php?id=$id&sequence=$password
If the URL above is not an active link, please copy and paste it into your browser address bar
Login after successful activation using your:
Username: $player
Password: $pass2
See you on the site!
admin@worldofbattle.co.cc";
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text\r\n";
mail($to, $subject, $message, $headers);
$msgToUser = "<h2>One Last Step - Activate through Email</h2><h4>OK $player, one last step to verify your email identity:</h4><br />
In a moment you will be sent an Activation link to your email address.<br /><br s/>
<br />
<strong><font color=\"#990000\">VERY IMPORTANT:</font></strong>
If you check your email with your host providers default email application, there may be issues with seeing the email contents. If this happens to you and you cannot read the message to activate, download the file and open using a text editor. If you still cannot see the activation link, contact site admin and briefly discuss the issue.<br /><br />
";
exit();
}
}
}
else
{
print "Your password didn't match or you did not enter a password";
echo " <A href='register.php'>Go back</a><br>";
exit;
}
echo " <A href='index.php'>Login Page</a><br>";
?>