Как мога да направя след регистрацията да може направо да се влезе, не да трябва да се активира от емайла
Код:
<?php
include "connect.php";
?>
<link rel="stylesheet" href="style.css" type="text/css">
<?php
print "<center>";
print "<table class='maintable'>";
print "<tr class='headline'><td><font color='white'><center>Register</center></td></tr>";
print "<tr class='mainrow'><td><center>";
$username=$_POST['username'];
$password=$_POST['password'];
$email=$_POST['email'];
$password=md5($password);
$randsseed=date("U")%10000000;
srand($randsseed);
$validationkey=rand(1000,10000);
$validationkey=md5($validationkey);
$checkemail="SELECT eatid from eatyou_login where eatemail='$email' or eatname='$username'";
$checkmail2=mysql_query($checkemail) or die("Could not check emails");
$checkmail3=mysql_num_rows($checkmail2);
if(strlen($username)<3)
{
print "Username have to be at least 4 characters long.";
}
else if($checkmail3>0)
{
print "There is already another player with that email address or that name.";
}
else
{
$insertadmin="INSERT into eatyou_login (eatname,eatpass,eatvalidated,validkey,eatemail) values('$username','$password','0','$validationkey','$email')";
mysql_query($insertadmin) or die(mysql_error());
mail($email,"Pwn you game registration","Thank you for registering, please validate your account by clicking this link $path/validated.php?user=$username&validatekey=$validationkey",$yourmail);
print "Player Registered, you will need to validate your account with the validation code sent to your email.";
print "</td></tr></table>";
}
?>