Location: PHPKode > projects > Helpdesk Over Web > how/users/editrecord-process.php
// Processes changes to user database entries.

// Include Configuration File

// Set Page Title and Include HTML Header
$page_title = 'HOW - User Database Administration';

// Connect to Database
require_once ('../includes/mysql_connect.php');

// Retrieve values from form and assign to variables. 
$userid = $_POST['userid'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$dept = $_POST['dept'];
$site = $_POST['site'];
$tel = $_POST['tel'];
$email = $_POST['email'];

// Execute SQL query.
$sql = "REPLACE INTO users (UserID, UserFirstName, UserSurname, Dept, Site, Tel, Email) VALUES ('$userid', '$firstname', '$surname', '$dept', '$site', '$tel', '$email')";
$result = mysql_query($sql)
   or die("Invalid query: " . mysql_error());

// Echo text to screen.
echo "<H3>User Database Record Updated</H3>";
echo "<P>The record for User <b>$userid</b> (<b>$firstname $surname</b> in <b>$dept</b>) has been updated.</P>";
echo "<H5>[ <A HREF='useradmin.php?sortorder=UserSurname'>User Database Administration</A> ]</H5>";

// Include HTML footer.
Return current item: Helpdesk Over Web