G
Ghznl
Guest
Hi I am a beginner in coding and I'm trying to create a website using php and mysql.
I am using a register script that I found on the web but I don't know what is wrong. When I type values in my other file(register.html) it says Congratulations! You have successfully registered! but the data isn't stored into the database.... Does anyone see something I'm missing?
<?php
$userName = $_POST['Username'];
$Password = $_POST['Password'];
$Email = $_POST['E-mail'];
mysql_connect ("xxxxxxx", "xxxxxxxx", "xxxxxxxxx")or die(mysql_error());
mysql_select_db ("xxxxxxxxx")or die(mysql_error());
$sql="INSERT INTO Userlist (ID, Username, E-mail, Password) VALUES ('NULL','".$userName."', '".$Email."', '".$Password."')";
mysql_query($sql);
echo '<p>Congratulations! You have successfully registered! </p> <p>Click <a href="login.php">here</a> to login.</p>';
?>
I am using a register script that I found on the web but I don't know what is wrong. When I type values in my other file(register.html) it says Congratulations! You have successfully registered! but the data isn't stored into the database.... Does anyone see something I'm missing?
<?php
$userName = $_POST['Username'];
$Password = $_POST['Password'];
$Email = $_POST['E-mail'];
mysql_connect ("xxxxxxx", "xxxxxxxx", "xxxxxxxxx")or die(mysql_error());
mysql_select_db ("xxxxxxxxx")or die(mysql_error());
$sql="INSERT INTO Userlist (ID, Username, E-mail, Password) VALUES ('NULL','".$userName."', '".$Email."', '".$Password."')";
mysql_query($sql);
echo '<p>Congratulations! You have successfully registered! </p> <p>Click <a href="login.php">here</a> to login.</p>';
?>