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
Software Development
Programming
Programming Q&A
PHP registration form
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="TylerTheJames" data-source="post: 340088" data-attributes="member: 60277"><p>Hi all, recently when I was going to make a register page (non habbo related) and put in everything I went to reigster and it doesnt give any error and redirects back to the login page, but when I refresh the db it doesnt show that a new account has been created</p><p>Code:</p><p>registration.php</p><p>[PHP]<?php</p><p>if(isset($_POST["submit"])){</p><p></p><p>if(!empty($_POST['email']) && !empty($_POST['pass'])) {</p><p> $email=$_POST['email'];</p><p> $password=$_POST['pass'];</p><p> $name=$_POST['name'];</p><p> $number=$_POST['number'];</p><p> $content=$_POST['content'];</p><p></p><p> $con=mysql_connect('localhost','root','*****') or die(mysql_error());</p><p> mysql_select_db('test1') or die("cannot select DB");</p><p></p><p> $query=mysql_query("SELECT * FROM php_users_login WHERE email='".$email."'");</p><p> $numrows=mysql_num_rows($query);</p><p> if($numrows==0)</p><p> {</p><p> $sql="INSERT INTO `php_users_login`(`id`, `email`, `password`, `name`, `phone`, `content`, `last_login`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7])";</p><p></p><p> $result=mysql_query($sql);</p><p></p><p></p><p> if($result){</p><p> echo "Account Successfully Created";</p><p> } else {</p><p> echo "Failure!";</p><p> }</p><p></p><p> } else {</p><p> echo "That username already exists! Please try again with another.";</p><p> }</p><p></p><p>} else {</p><p> echo "All fields are required!";</p><p>}</p><p>}</p><p>?>[/PHP]</p><p>I have all the columns right, etc.</p><p>PS- Just started using php 2 days ago so the noob level is high right now</p></blockquote><p></p>
[QUOTE="TylerTheJames, post: 340088, member: 60277"] Hi all, recently when I was going to make a register page (non habbo related) and put in everything I went to reigster and it doesnt give any error and redirects back to the login page, but when I refresh the db it doesnt show that a new account has been created Code: registration.php [PHP]<?php if(isset($_POST["submit"])){ if(!empty($_POST['email']) && !empty($_POST['pass'])) { $email=$_POST['email']; $password=$_POST['pass']; $name=$_POST['name']; $number=$_POST['number']; $content=$_POST['content']; $con=mysql_connect('localhost','root','*****') or die(mysql_error()); mysql_select_db('test1') or die("cannot select DB"); $query=mysql_query("SELECT * FROM php_users_login WHERE email='".$email."'"); $numrows=mysql_num_rows($query); if($numrows==0) { $sql="INSERT INTO `php_users_login`(`id`, `email`, `password`, `name`, `phone`, `content`, `last_login`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7])"; $result=mysql_query($sql); if($result){ echo "Account Successfully Created"; } else { echo "Failure!"; } } else { echo "That username already exists! Please try again with another."; } } else { echo "All fields are required!"; } } ?>[/PHP] I have all the columns right, etc. PS- Just started using php 2 days ago so the noob level is high right now [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP registration form
Top