Please help....i want to save a user to my database..using wampserver...
<form method="POST" action="">
<center><br>
<H1>USER REGISTRATION</H1>
<table>
<tr>
<td>User Id</td>
<td><input type="text" name="userId"></td>
</tr>
<tr>
<td>Lastname</td>
<td><input type="text" name="lastname"></td>
</tr>
<tr>
<td>Firstname</td>
<td><input type="text" name="firstname"></td>
</tr>
<tr>
<td>Middle Name</td>
<td><input type="text" name="middleName"></td>
</tr>
<tr>
<td>Suffix</td>
<td><input type="text" name="suffix"></td>
</tr>
<tr>
<td>Position</td>
<td><input type="text" name="position"></td>
</tr>
<tr>
<td>Privilege</td>
<td><select name="priv">
<option>Administrator</option>
<option>User</option>
</select>
</td>
</tr>
<tr>
<td>Username</td>
<td><input type="username" name="username" ></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" ></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="save" value="Save"></td>
</tr>
</table>
</form>
<?php
include '../config/connect.php';
if (isset($_POST['save']))
{
$userId= strtoupper($_POST['userId']);
$lastname= strtoupper($_POST['lastname']);
$firstname=strtoupper($_POST['firstname']);
$middleName= strtoupper($_POST['middleName']);
$suffix= strtoupper($_POST['suffix']);
$position= strtoupper($_POST['position']);
$privilege=strtoupper($_POST['priv']);
$userName=$_POST['username'];
$password=$_POST['password'];
$query = "INSERT INTO users
VALUES (Null,'$userId',
'$lastname',
'$firstname',
'$middleName',
'$suffix',
'$position',
'$privilege',
'$userName',
'$password')";
$result = mysqli_query($query);
if ($result)
{
echo "<center>Successfully Saved!</center>";
}
else
{
echo "<center>User Account Saving Failed!</center>";
}
}
?>