Daltron
Web Developer
Alrighty so, here is my code
so basically upon registration it takes me to the /me page but it doesnt ever add the user into the users table.
All help is greatly appreciated thanks xx
PHP:
<?php require_once("inc/core.god.php");
if(Loged == TRUE)
{
header("Location: me");
exit;
}
if(MANTENIMIENTO == '1')
{
header("Location: mantenimiento");
exit;
}
if(isset($_POST['Usuario']) && isset($_POST['Mail']) && isset($_POST['Contrasena']) && isset($_POST['RContrasena']) && isset($_POST['Contracode']))
{
$Getnombre = mysql_query("SELECT * FROM users WHERE username = '". $_POST['Usuario'] ."'");
$Getmail = mysql_query("SELECT * FROM users WHERE mail = '". $_POST['Mail'] ."'");
if(empty($_POST['Usuario']) || empty($_POST['Mail']) || empty($_POST['Contrasena']) || empty($_POST['RContrasena']) || empty($_POST['Contracode']))
{
$regerror = 'Do not leave the fields empty';
}
elseif(mysql_num_rows($Getnombre) > 0)
{
$regerror = 'The username is already in use, put another';
}
elseif(mysql_num_rows($Getmail) > 0)
{
$regerror = 'The email is already in use, put another';
}
elseif($_POST['Contrasena'] !== $_POST['RContrasena'])
{
$regerror = 'Passwords do not match';
}
elseif(strlen($_POST['Usuario']) > 12 || strlen($_POST['Usuario']) < 3)
{
$regerror = 'The username must be between 3 and 12 characters';
}
elseif(strrpos($_POST['Usuario'], "MOD-") !== false)
{
$regerror = 'You can not register with the prefix <i>MOD-</i>';
}
elseif(strrpos($_POST['Usuario'], " ") || strrpos($_POST['Usuario'], " ") !== false)
{
$regerror = 'Your name can not contain spaces';
}
elseif(strrpos($_POST['Usuario'], ".") || strrpos($_POST['Usuario'], ".") !== false)
{
$regerror = 'Your name can not contain points';
}
else
{
mysql_query("INSERT INTO users (username, password, passcode, mail, look, gender, motto, ip_register, credits, account_created, account_day_of_birth) VALUES ('". filtro($_POST['Usuario']) ."', '".md5($_POST['Contrasena'])."', '".md5($_POST['Contracode'])."', '". filtro($_POST['Mail']) ."', '". $Holo['look'] ."', '". $Holo['gender'] ."', '". $Holo['mision'] ."', '". $ip ."', '". $Holo['monedas'] ."', '" . time() ."', '" . time() ."')");
$_SESSION['Username'] = $_POST['Usuario'];
$_SESSION['Password'] = $_POST['Contrasena'];
$_SESSION['Contracode'] = $_POST['Contracode'];
header("Location: way");
}
}
$_GET['Usuario'] = $_POST['Usuario'];
$_GET['Mail'] = $_POST['Mail'];
$_GET['Contrasena'] = $_POST['Contrasena'];
$_GET['RContrasena'] = $_POST['RContrasena'];
$_GET['Contracode'] = $_POST['Contracode'];
?>
so basically upon registration it takes me to the /me page but it doesnt ever add the user into the users table.
All help is greatly appreciated thanks xx