include 'mysqlconnect.php';
$register_attempt=0;
if(isset($_POST['register'])){$register_attempt=$_POST['register'];}
if ($register_attempt == 1)
{
$db = mysql_select_db("linksave", $con);
if (!$db)
{
die('Can not Connect to Database: ' . mysql_error());
}
$first_name =$_POST['firstname'];
$last_name =$_POST['lastname'];
$username =$_POST['username'];
$password =$_POST['password'];
$email_address =$_POST['email'];
$country =$_POST['country'];
$state =$_POST['state'];
$city =$_POST['city'];
$address =$_POST['address'];
$age =$_POST['age'];
$user_ip =$_SERVER['REMOTE_ADDR'];
$sql="INSERT INTO members (first_name, last_name, username, password, email, country, state, city, address, age, user_ip)
VALUES
('$first_name','$last_name','$username',MD5('$password'),'$email_address','$country','$state','$city','$address','$age','$user_ip')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
header('location:linksave.php');
mysql_close($con)
;}
?>
It pretty much gets information in a form and sends it to a mysql database, in my case WAMP, does anyone know which file i should put this code into to make it work?