Location: PHPKode > projects > Modular Site Manager > htdocs/misc/register.php
<? 
if($_POST['pass1'] !== $_POST['pass2'])
{
	die("Password mismatch. Make sure it's correct!");
}
chdir("../");
include("inc/functions.inc.php");
$trupass = dohash(MY_SECRET.$_POST['pass1']);
$name = $_POST['username'];
$mysql = new mysql(DB_MAIN);
if(mysql_num_rows($mysql->select(PRE."members", "email='".$_POST['email']."'", "id", "DESC")) > "0")
{
	die("E-Mail taken! Please choose another");
} 
elseif(mysql_num_rows($mysql->select(PRE."members", "username='".$_POST['username']."'", "id", "DESC")) > "0")
{
	die("Username taken! Please choose another");
}
else
{
	$rand = cut(rand(), 16, NULL);
	$memid = $mysql->select(PRE."members", NULL, "id", "DESC", "1");
	$memid = mysql_fetch_array($memid);
	$memid = $memid['id']+1;
	$mysql->query("INSERT INTO `".PRE."members` ( `username` , `password` , `groups` , `joindate` , `email` ) 
	VALUES ('".$name."', '".$trupass."', '2', NOW( ), '".$_POST['email']."')");
	
	$mysql->query("INSERT INTO `".PRE."members_temp` ( `memid` , `email` , `actstring` ) 
	VALUES ('".$memid."', '".$_POST['email']."', '".$rand."')");
	
	mail($_POST['username']." <".$_POST['email'].">", "Vouksh.info Registration", "Thank you for registering at Vouksh.info. To use your account, please activate it using the URL below\n\n".SITE_URL."misc/activate.php?actstring=".$rand."&email=".$_POST['email']." \n\nYour account information is as follows:\nUsername: ".$_POST['username']."\nPassword: ".$_POST['pass1']."\n\nIf you think this is a mistake, send a reply to this email saying so, and your information will be removed from our database.\nPlease save this email for your reference, because we cannot recover your password later. \n\n\tThanks for registering!\n\t\tVouksh", "FROM: Vouksh.info <hide@address.com>");
	
	mail("Vouksh <hide@address.com>", "Vouksh.info Registration", "A new user has registered using the email address ".$_POST['email']." under the username ".$_POST['username'].".\nTheir IP address was ".$REMOTE_ADDR.", and their hostname was ".gethostbyaddr($REMOTE_ADDR).".", "FROM: Vouksh.info Alerts <hide@address.com>");
	header("Location: ".SITE_URL."v5/Registered");
}
	
?>
Return current item: Modular Site Manager