Here is my register form:
<p>Please fill out all fields</p><br>
<form method="POST" action="login/login.php">
<!-- name is the VARIABLE -->
Username: <input type="text" name="username"></br>
Password: <input type="password" name="password"></br>
Email: <input type="text" name="email"></br>
</form>
</br>
</br>
<form method="POST" action="login/process.php" "> </br>
<input type='submit' value='submit registration'/>
</form>
here is my process.php file:
<?php
print "<center>";
$Username = $_POST["username"];
$Password = $_POST["password"];
$Email = $_POST["email"];
?>
<?php
include "../shopdb/connection.php";
$query="INSERT INTO USERS (ID, Username, Password, Email) VALUES ('','$Username','$Password','$Email')";
mysql_query($query,$connect);
?>
I keep getting this error:
Notice: Undefined index: username in C:\xampp\htdocs\IIS\login\process.php on line 3
Notice: Undefined index: password in C:\xampp\htdocs\IIS\login\process.php on line 4
Notice: Undefined index: email in C:\xampp\htdocs\IIS\login\process.php on line 5
You are successfully connected to the database.
(the bottom message is a part of the connection script I added to show I’m connected to the DB)..
Any help would be great.
You have your submit button in a form that is separate from the form that your text fields are in. This should work:
By the way, you should be checking to see if variables exist before you use them: