Location: PHPKode > projects > Gsys > php/brother_edit_info2.php
<?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">
    <tr>
      <td width="151">First Name: </td>
      <td width="242"><input type="text" name="f_name" size="30" value="<?php echo "$f_name" ?>"></td>
    </tr>
    <tr>
      <td>Middle Name: </td>
      <td><input type="text" name="m_name" size="30" value="<?php echo "$m_name" ?>"></td>
    </tr>
    <tr>
      <td>Last Name: </td>
      <td><input type="text" name="l_name" size="30" value="<?php echo "$l_name" ?>"></td>
    </tr>
    <tr>
      <td>E-mail:        </td>
      <td><input type="text" name="email" size="30" value="<?php echo "$email" ?>"></td>
    </tr>
    <tr>
      <td>Nickname: <br /></td>
      <td><input type="text" name="nickname" size="30" value="<?php echo "$nickname" ?>"></td>
    </tr>
    <tr>
      <td>Phone Number: </td>
      <td><input type="text" name="phone" size="30" value="<?php echo "$phone" ?>"></td>
    </tr>
    <tr>
      <td height="24">Address: </td>
      <td><input type="text" name="address" size="30" value="<?php echo "$address" ?>"></td>
    </tr>
    <tr>
      <td>Town: </td>
      <td><input type="text" name="town" size="30" value="<?php echo "$town" ?>"></td>
    </tr>
    <tr>
      <td>State:</td>
      <td><input type="text" name="state" size="4" value="<?php echo "$state" ?>"></td>
    </tr>
    <tr>
      <td>Zip Code: </td>
      <td><input type="text" name="zip" size="10" value="<?php echo "$zip" ?>"></td>
    </tr>
    <tr>
      <td>Initiation Date:</td>
      <td><input type="text" name="initiation_date" size="11" value="<?php echo "$initiation_date" ?>"></td>
    </tr>
    <tr>
      <td>Date of Birth: </td>
      <td><input type="text" name="dob" size="11" value="<?php echo "$dob" ?>"></td>
    </tr>
    <tr>
      <td>Current Position Held: </td>
      <td><input type="text" name="pos" size="30" value="<?php echo "$pos" ?>"></td>
    </tr>
    <tr>
      <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>
    </tr>
  </table>
</form>
<?php include ('../includes/footer.php'); ?>
Return current item: Gsys