<?php
session_start();
require "mysql.php";
global $c;
if ( $_GET['act'] == 'val')
{
$q=mysql_query("SELECT * FROM validating WHERE vdID='{$_GET['token']}'", $c);
if (!mysql_num_rows($q))
{
die("Invalid account");
}
$r=mysql_fetch_array($q);
$pass=strip_tags($r['vdPASSW']);
$pass=md5($pass);
$username=($r['vdUSERN']);
$email=($r['vdEMAIL']);
$money=($r['vdMONEY']);
mysql_query("INSERT INTO users (username,userpass,email,login_name,maxenergy,maxwill,maxbrave,maxhp,energy,will,hp,brave,level,location,money,turns,cybermoney,bankmoney,signedup) values('$username','$pass','$email','$username','12','100','3','100','12','100','100','3','1','1','$money','100','-1','-1',unix_timestamp() )",$c) or die(mysql_error());
$i=mysql_insert_id($c);
mysql_query("INSERT INTO `userstats` VALUES($i, 10, 10, 10, 10, 10, 10, 10, 10)", $c);
mysql_query("INSERT INTO `inventory` (inv_id, inv_itemid, inv_userid, inv_qty) VALUES ('', '195', '{$i}', '400')", $c);
mysql_query("INSERT INTO `inventory` (inv_id, inv_itemid, inv_userid, inv_qty) VALUES ('', '33', '{$i}', '10')", $c);
//
include_once('global_func.php');
event_add($i, "welcome to the Mafia Lords. You have been given a few start Items. Check your items for more details", $c);
$time = time()+5;
$subject = 'Welcome to Mafia-Lords';
$body = 'Welcome to the game.<br /><br />Please let me know if you need anything, any help, or any advice.<br /><br />Please check out the Help Tutorial in the bottom left corner for anything you need to know or contact ID 1 or ID 5. Thanks Steve<br /><br />';
mysql_query
(
"INSERT INTO `mail` (mail_id, mail_read, mail_from, mail_to, mail_time, mail_subject, mail_text) ".
"VALUES ('', '0', '1', '{$i}', '{$time}', '{$subject}', '{$body}')",$c);
//
mysql_query("INSERT INTO userstats VALUES($i,10,10,10,10,10)",$c);
mysql_query("DELETE FROM validating WHERE vdID='{$_GET['token']}'", $c);
print "Account validated!<br />
<a href='login.php'>> Login</a>";
}
else
{
mysql_query("DELETE FROM validating WHERE vdID='{$_GET['token']}'", $c);
print "Registration Cancelled.";
}
?>
this is my val.php