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
Why is this SQL not working
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="Gang67" data-source="post: 419812" data-attributes="member: 75598"><p>It isn't sending the data to my database nor showing error messages</p><p></p><p>[CODE]<?php</p><p>session_start();</p><p>//connect to database</p><p>$db=mysqli_connect("localhost","root","{DB PASSWORD}","rppp");</p><p>if(isset($_POST['register_btn']))</p><p>{</p><p> $username=mysql_real_escape_string($_POST['username']);</p><p> $email=mysql_real_escape_string($_POST['email']);</p><p> $password=mysql_real_escape_string($_POST['password']);</p><p> $password2=mysql_real_escape_string($_POST['password2']);</p><p> if($password==$password2)</p><p> { //Create User</p><p> $password=md5($password); //hash password before storing for security purposes</p><p> $sql="INSERT INTO users(username,email,password) VALUES('$username','$email','$password')";</p><p> mysqli_query($db,$sql);</p><p> $_SESSION['message']="You are now logged in";</p><p> $_SESSION['username']=$username;</p><p> header("location:home.php"); //redirect home page</p><p> }</p><p> else</p><p> {</p><p> $_SESSION['errormessage']="The two password do not match"; </p><p> }</p><p>}</p><p>?>[/CODE]</p><p></p><p>[CODE]<div class="content"></p><p><form method="post"></p><p> <input type="text" name="username" id="username" class="form" placeholder="Username"> <br /><br /></p><p> <input type="text" name="email" id="email" class="form" placeholder="Email"> <br /><br /></p><p> <input type="password" name="password" id="password" class="form" placeholder="Password"> <br /><br /></p><p> <input type="password" name="password2" id="password2" class="form" placeholder="Verify Password"> <br /><br /></p><p> <input type="submit" name="register_btn" id="register_btn" class="submit"></p><p> </form>[/CODE]</p></blockquote><p></p>
[QUOTE="Gang67, post: 419812, member: 75598"] It isn't sending the data to my database nor showing error messages [CODE]<?php session_start(); //connect to database $db=mysqli_connect("localhost","root","{DB PASSWORD}","rppp"); if(isset($_POST['register_btn'])) { $username=mysql_real_escape_string($_POST['username']); $email=mysql_real_escape_string($_POST['email']); $password=mysql_real_escape_string($_POST['password']); $password2=mysql_real_escape_string($_POST['password2']); if($password==$password2) { //Create User $password=md5($password); //hash password before storing for security purposes $sql="INSERT INTO users(username,email,password) VALUES('$username','$email','$password')"; mysqli_query($db,$sql); $_SESSION['message']="You are now logged in"; $_SESSION['username']=$username; header("location:home.php"); //redirect home page } else { $_SESSION['errormessage']="The two password do not match"; } } ?>[/CODE] [CODE]<div class="content"> <form method="post"> <input type="text" name="username" id="username" class="form" placeholder="Username"> <br /><br /> <input type="text" name="email" id="email" class="form" placeholder="Email"> <br /><br /> <input type="password" name="password" id="password" class="form" placeholder="Password"> <br /><br /> <input type="password" name="password2" id="password2" class="form" placeholder="Verify Password"> <br /><br /> <input type="submit" name="register_btn" id="register_btn" class="submit"> </form>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Why is this SQL not working
Top