Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
MySQL not allowing INSERT querys or im bad at coding one of the two
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Daltron" data-source="post: 452875" data-attributes="member: 61885"><p>Alrighty so, here is my code </p><p></p><p>[CODE=php]<?php require_once("inc/core.god.php");</p><p> </p><p> if(Loged == TRUE)</p><p> {</p><p> header("Location: me");</p><p> exit;</p><p> }</p><p> </p><p> if(MANTENIMIENTO == '1')</p><p> {</p><p> header("Location: mantenimiento");</p><p> exit;</p><p> }</p><p> </p><p> if(isset($_POST['Usuario']) && isset($_POST['Mail']) && isset($_POST['Contrasena']) && isset($_POST['RContrasena']) && isset($_POST['Contracode']))</p><p> { </p><p> </p><p> $Getnombre = mysql_query("SELECT * FROM users WHERE username = '". $_POST['Usuario'] ."'");</p><p> $Getmail = mysql_query("SELECT * FROM users WHERE mail = '". $_POST['Mail'] ."'");</p><p> </p><p> if(empty($_POST['Usuario']) || empty($_POST['Mail']) || empty($_POST['Contrasena']) || empty($_POST['RContrasena']) || empty($_POST['Contracode']))</p><p> {</p><p> $regerror = 'Do not leave the fields empty';</p><p> }</p><p> elseif(mysql_num_rows($Getnombre) > 0)</p><p> {</p><p> $regerror = 'The username is already in use, put another';</p><p> }</p><p> elseif(mysql_num_rows($Getmail) > 0)</p><p> {</p><p> $regerror = 'The email is already in use, put another';</p><p> }</p><p> elseif($_POST['Contrasena'] !== $_POST['RContrasena'])</p><p> {</p><p> $regerror = 'Passwords do not match';</p><p> }</p><p> elseif(strlen($_POST['Usuario']) > 12 || strlen($_POST['Usuario']) < 3)</p><p> {</p><p> $regerror = 'The username must be between 3 and 12 characters';</p><p> }</p><p> elseif(strrpos($_POST['Usuario'], "MOD-") !== false)</p><p> {</p><p> $regerror = 'You can not register with the prefix <i>MOD-</i>';</p><p> }</p><p> elseif(strrpos($_POST['Usuario'], " ") || strrpos($_POST['Usuario'], " ") !== false)</p><p> {</p><p> $regerror = 'Your name can not contain spaces';</p><p> }</p><p> elseif(strrpos($_POST['Usuario'], ".") || strrpos($_POST['Usuario'], ".") !== false)</p><p> {</p><p> $regerror = 'Your name can not contain points';</p><p> }</p><p> else</p><p> {</p><p> 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() ."')");</p><p> $_SESSION['Username'] = $_POST['Usuario'];</p><p> $_SESSION['Password'] = $_POST['Contrasena'];</p><p> $_SESSION['Contracode'] = $_POST['Contracode'];</p><p> header("Location: way");</p><p> }</p><p> }</p><p> </p><p> $_GET['Usuario'] = $_POST['Usuario'];</p><p> $_GET['Mail'] = $_POST['Mail'];</p><p> $_GET['Contrasena'] = $_POST['Contrasena'];</p><p> $_GET['RContrasena'] = $_POST['RContrasena'];</p><p> $_GET['Contracode'] = $_POST['Contracode'];</p><p> </p><p>?>[/CODE]</p><p></p><p>so basically upon registration it takes me to the /me page but it doesnt ever add the user into the users table.</p><p>All help is greatly appreciated thanks xx</p></blockquote><p></p>
[QUOTE="Daltron, post: 452875, member: 61885"] Alrighty so, here is my code [CODE=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']; ?>[/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 [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
MySQL not allowing INSERT querys or im bad at coding one of the two
Top