session_start();
if($_SESSION['ZUID']) header("location:home.php"); // go to home if already registered
/////////////////get database and other stuff
require_once("../!!INCL/WYNTK1.php"); // stores system variables
require_once("../!!INCL/OARSfunc1.php"); // system function store
$ip = getRealIpAddr() ;// use to get real IP if required
/// set the return file name for POST forms
$ffrom1 = $_SERVER["REQUEST_URI"] ;
$ffrom2 = "signup.php" ;
$ffrom = $ffrom2 ; //////////going to come back here
/// if button pressed...
if(isset($_POST['btn-signup']))
{
/// if has been posted then collect data
$uname = trim($_POST['txtuname']);
$rname = trim($_POST['txtrname']);
$email = trim($_POST['txtemail']);
$pass = trim($_POST['txtpass']);
$club = trim($_POST['txtclub']);
$usage = trim($_POST['txtusage']);
$timezone = trim($_POST['tzone']);
$type = "standard" ; // or beta/admin/tester/dummy
$notes = "New registered user";
$t1 = "new" ;
$t2 = $pass ;
$status = "N" ;
$level = 0 ;
$um = 0 ;
$code = md5(uniqid(rand())); // random code
$res2 = mysql_query('SELECT * FROM `M_regusers` WHERE `userName` = \''.$uname.'\' ' ) ;
if ($res2 == false) echo "
Error getting event SQL: ".mysql_error($db)."
" ;
if (mysql_num_rows($res2) > 0) {
// already have username
$msg = "
Sorry ! that username is in use, Please choose another...
";
}
else {
// username unique so ok to enter a new regsistration
$level = 0 ; // first registration user
$temp2 = $pass ; // puts real pw in for testing
if (registernewuser($uname, $rname, $email, $status, $level, $club, $um, $usage, $type, $timezone, $notes, $t1, $t2, $ip, $pass, $code))
{
// come back true..
//$id = $reg_user->lasdID();
$id1 = mysql_insert_id($con) ;
// $id = $this->con->lastInsertId();
$key = base64_encode($id1);
$id = $key;
$message = "
Hello $rname,
Welcome to OARS321 system and thank you for registering...
Your registration under username $uname will be complete once you have activated
your account by clicking this link Click HERE to Activate
If you did not instigate this registration then please ignore this email, as unconfirmed emails will be deleted after 3 days, and accept our apologies.
Success!
Welcome, $rname, We've sent you an email to $email .
Please click on the confirmation link in that email to activate your account.
You will not be able to log into your account until it is activated.
newuser $id email was $sent ;
";
}
else echo "Sorry , Query could not be executed... try again later...";
}
}
?>
OARS321 Registration