<?php
$conn= new mysqli("localhost", "my_user", "my_password", "world"); //changed for the sake of this question
$username = $_POST['Username'];
$password = sha1($_POST['Password']);
$email = $_POST['Email'];
$firstname = $_POST['FirstName'];
$lastname = $_POST['LastName'];
$insert = 'INSERT INTO User(FirstName, LastName, Email, Username, Password, Type) VALUES ("'.$firstname.'", "'.$lastname.'", "'.$email.'", "'.$username.'", "'.$password.'", 'User');';
$result = $conn->query($insert);
?>
<form method='post' action='regprocess.php'>
<fieldset class="register">
<h2>Register</h2>
<ul>
<li><label for="FirstName">First Name: </label> <input type="text" name="FirstName" id="FirstName"></li>
<li><label for="LastName">Last Name: </label> <input type="text" name="LastName" id="LastName"></li>
<li><label for="Email">Email: </label><input type="email" name="Email" id="Email"></li>
<li><label for="Username">Username: </label><input type="text" name="Username" id="Username"></li>
<li><label for="Password">Password: </label><input type="password" name="Password" id="Password"></li>
<li><input type="submit" value="Register"></li>
</ul>
</fieldset></form>
The form and the top sql code are in separate files.
Hello everybody, I'm trying to insert into an mysql table, and it won't insert into my table. I'm trying to get it to insert through a registration table. And I'm not quite sure why it's not working. Some insight would be great. If you need me to provide the table I will, but I don't think it's part of the reason it's not working.
Useris in wrong color?Userpart so it becomes\'User\'.