Location: PHPKode > projects > Gsys > php/brother_edit_info2.php
//Filename : brother_edit_info2.php  ~ Marty's version
//Description : Allow users to update information in database
//Author :  Marty, darc
//Last modified :  2006.12.20

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

$sql ="SELECT l_name, m_name, f_name, nickname, phone, address, town, state, zip, initiation_date, dob, email, status, pos 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'];
    $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'];
	$status = $row['status'];
	$pos = $row['pos'];
$title = "Edit Account";
include ('../includes/header.php'); 
<form method="post" action="do_edit_account2.php">
  <p><em>Follow input formattings provided</em><br />
    <em>All fields required</em></p>
  <table width="431" border="0">
      <td width="151">First Name: </td>
      <td width="242"><input type="text" name="f_name" size="30" value="<?php echo "$f_name" ?>"></td>
      <td>Middle Name: </td>
      <td><input type="text" name="m_name" size="30" value="<?php echo "$m_name" ?>"></td>
      <td>Last Name: </td>
      <td><input type="text" name="l_name" size="30" value="<?php echo "$l_name" ?>"></td>
      <td>E-mail:        </td>
      <td><input type="text" name="email" size="30" value="<?php echo "$email" ?>"></td>
      <td>Nickname: <br /></td>
      <td><input type="text" name="nickname" size="30" value="<?php echo "$nickname" ?>"></td>
      <td>Phone Number: </td>
      <td><input type="text" name="phone" size="30" value="<?php echo "$phone" ?>"></td>
      <td height="24">Address: </td>
      <td><input type="text" name="address" size="30" value="<?php echo "$address" ?>"></td>
      <td>Town: </td>
      <td><input type="text" name="town" size="30" value="<?php echo "$town" ?>"></td>
      <td><input type="text" name="state" size="4" value="<?php echo "$state" ?>"></td>
      <td>Zip Code: </td>
      <td><input type="text" name="zip" size="10" value="<?php echo "$zip" ?>"></td>
      <td>Initiation Date:</td>
      <td><input type="text" name="initiation_date" size="11" value="<?php echo "$initiation_date" ?>"></td>
      <td>Date of Birth: </td>
      <td><input type="text" name="dob" size="11" value="<?php echo "$dob" ?>"></td>
      <td>Current Position Held: </td>
      <td><input type="text" name="pos" size="30" value="<?php echo "$pos" ?>"></td>
      <td height="20"><input type="SUBMIT" name="submit" value="Submit"></td>
      <td>&nbsp;<INPUT TYPE="HIDDEN" NAME="username" VALUE="<?php echo $_SESSION[current_user] ?>"></td>
<?php include ('../includes/footer.php'); ?>
Return current item: Gsys