Location: PHPKode > projects > Gsys > php/brother_edit_info.php
<?PHP
//Filename : brother_edit_info.php  ~ the darc version
//Description :  Allows a user to change their information in database
//Author :  darc
//Last modified :  2006.12.20

include ('../includes/db.php');
include ('../includes/auth.php');

$sql ="SELECT username, l_name, m_name, f_name, nickname, phone, address, town, state, zip, initiation_date, dob, email, on_off_campus, house, status, pos, AES_DECRYPT(id, '46eastlawn') as id FROM $table_name where username='$_SESSION[current_user]';";

$result = mysql_query($sql,$connection) or die(mysql_error());

while($row =mysql_fetch_array($result))
        {
    $f_name = $row['f_name'];
	$m_name = $row['m_name'];
    $l_name = $row['l_name'];
	$nickname = $row['nickname'];
    $username = $row['username'];
    $phone = $row['phone'];
    $email = $row['email'];
    $address = $row['address'];
    $town = $row['town'];
    $state = $row['state'];
    $zip = $row['zip'];
    $initiation_date = $row['initiation_date'];
    $dob = $row['dob'];
    $on_off_campus = $row['on_off_campus'];
	$house = $row['house'];
	$status = $row['status'];
	$pos = $row['pos'];
	$id = $row['id'];
        }
?>
<html>
<head><title>Edit Account</title></head>
<body>
<br /><br />
<form method="post" action="do_edit_account.php">
<em>Follow input formattings provided</em><br />
<em>All fields required</em><br /><br />
Username (You can't change this):<INPUT TYPE="text" NAME="username" SIZE="30" value="<?php echo "$username" ?>"><br />
<br /><br />
Password: <INPUT TYPE="password" NAME="pass1" SIZE="30"><br />
Confirm Password:  <INPUT TYPE="password" NAME="pass2" SIZE="30"><br /><br />

First Name: <INPUT TYPE="text" NAME="f_name" SIZE="30" value="<?php echo "$f_name" ?>"><br />
Middle Name: <INPUT TYPE="text" NAME="m_name" SIZE="30" value="<?php echo "$m_name" ?>"><br />
Last Name: <INPUT TYPE="text" NAME="l_name" SIZE="30" value="<?php echo "$l_name" ?>"><br />
E-mail:  <INPUT TYPE="text" NAME="email" SIZE="30" value="<?php echo "$email" ?>"><br />
Nickname: <INPUT TYPE="text" NAME="nickname" SIZE="30" value="<?php echo "$nickname" ?>"><br />
Phone Number: <INPUT TYPE="text" NAME="phone" SIZE="30" value="<?php echo "$phone" ?>"><br />
Address: <INPUT TYPE="text" NAME="address" SIZE="30" value="<?php echo "$address" ?>"><br />
Town:  <INPUT TYPE="text" NAME="town" SIZE="30" value="<?php echo "$town" ?>"><br />
State:  <INPUT TYPE="text" NAME="state" SIZE="4" value="<?php echo "$state" ?>"><br />
Zip Code:  <INPUT TYPE="text" NAME="zip" SIZE="10" value="<?php echo "$zip" ?>"><br />
Initiation Date:  <INPUT TYPE="text" NAME="initiation_date" SIZE="11" value="<?php echo "$initiation_date" ?>"><br />
Date of Birth:  <INPUT TYPE="text" NAME="dob" SIZE="11" value="<?php echo "$dob" ?>"><br />
Current Position Held: <INPUT TYPE="text" NAME="pos" SIZE="30" value="<?php echo "$pos" ?>"><br />
On/Off Campus or House Residency: 
<input type="radio" name="on_off_campus" value="on">On Campus 
<input type="radio" name="on_off_campus" value="off"> Off Campus 
<input type="radio" name="house" value="house"> House
<br />
Student ID (You must include the "-"):  <INPUT TYPE="text" NAME="id" SIZE="11" value="<?php echo "$id" ?>"><br />
<br /><br />
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit">
</form>
<br /><br />
<em>Note:  Student ID's are stored securely, AES/Rijndael encrypted with restricted access.</em>
</body>
</html>
Return current item: Gsys