TylerTheJames
New Member
- Jun 14, 2015
- 4
- 0
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
I have all the columns right, etc.
PS- Just started using php 2 days ago so the noob level is high right now
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!";
}
}
?>
PS- Just started using php 2 days ago so the noob level is high right now