Hi guys.I am new to web development and of course I have been experiensing some problems.Most of them are easy to solve and I usually find my way, but there is some thing that is getting on my nerves for some time now.
I have been trying to make a simple script for registering a user via MySQL.No filtering input, no validating only the part that adds the new user into the MySQL table. But it doesn't work.I have checked my code a couple of times and i can't see the problem.Here it is:
<?php
if(isset($_POST["name"]) && isset($_POST["pass"]) && isset($_POST["email"]))
{
$name=$_POST["name"];
$pass=$_POST["pass"];
$email=$_POST["email"];
$con=mysql_connect('localhost','root','password');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("users", $con);
mysql_query("INSERT INTO members (username,password,email) values ('$name','$pass','$email')") or die('Error');
}
?>