php register script problem?

Nik

New member
I have been fiddling with this script but at the moment its being really un helpful to my delight the script does not error at all the problem is it doesn't work either so I suppose it does error. here is the php code for the form and registering script.

php script for database connection/submitting of details. Data is on register.php
______________
<?php
$host="localhost";
$username="admin";
$password="password";
$db_name="test";
$tbl_name="test2";

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$insert_query = 'insert into users (
username,
password,
email
)
values
(
"' . $_POST['username'] . '",
"' . $_POST['password'] . '",
"' . $_POST['email'] . '",
)';
mysql_query($insert_query);
?>
______________
Main form header
<form name="registration_form" method="post" action="register.php" onsubmit="return Validate();">

inputs are named according to the script above so assuming that the database details are correct
what other problem can you see. As mentioned it doesn't error it just doesn't do anything I have php my admin open and no details get entered.

thanks for any help
I know the "user" error don't worry its not in the script
some additional details the
mysql connect(host etc)
although I'm not saying there is no error there that part of the script was copied from a log in page i have that successfully logs you in if you exist
 
Back
Top