Here's edit1.php:
Code: Select all
<?
$db=mysql_connect("localhost","root","password");
mysql_select_db("staff",$db);
$login=mysql_query("select * from staff WHERE usrname='$loggedinїusr]' LIMIT 1", $db)
or die(mysql_error());
$rows=mysql_fetch_array($login);
?>
<form action="edit2.php" method="post">
UserName: <input type="text" name="username" value="<? echo $rowsїusrname] ?>">
<br>
Password: <input type="text" name="password" value="<? echo $rowsїpassword] ?>">
<br>
Real Name: <input type="text" name="rlname" value="<? echo $rowsїrlname] ?>">
<br>
E-Mail: <input type="text" name="email" value="<? echo $rowsїemail] ?>">
<br>
Location: <input type="text" name="location" value="<? echo $rowsїlocation] ?>">
<br>
<input type="hidden" name="oun" value="<? echo $rowsїusrname] ?>">
<input type="submit" name="submit" value="Edit Info">Code: Select all
<?
$db=mysql_connect("localhost","root","password");
mysql_select_db("staff",$db);
$login="UPDATE staff SET usrname='$username', password='$password', rlname='$rlname', email='$email', location='$location' where usrname='$_POSTїoun]'";
echo "Thank you, your information was successfully updated $usrname.";
?>