Code: Select all
<?php
if(isset($_POST["submit"]))
{
$selectStmt = "select * from users where username = '{$_GET['username']}'";
if(!($link=mysql_pconnect('localhost', 'root', '')))
{
echo 'Error connecting...Please send the following information to the site administrator!';
exit();
}
mysql_select_db('mobile', $link)or die("There was an error connecting to the database. Please send the following information to the site administrator.<br /><br />".mysql_error());
if(!($result=mysql_query($selectStmt, $link))){
echo 'Error executing statement...Please send the following information to the site administrator! '.mysql_error();
exit();
}
if(!($row=mysql_fetch_object($result))){
echo 'Internal Error: The entry does not exist! '.mysql_error();
exit();
}
printf('<FORM target="_blank" METHOD="post" ACTION="%s"><PRE>', "update.php?userID =$row->userID");
printf("userName:
<INPUT TYPE=text SIZE=35 NAME=username VALUE="%s">
<br>\n",$row->username);
printf("Password:
<INPUT TYPE=text SIZE=35 NAME=password VALUE="%s">
<br>\n",$row->password);
printf("</br>First Name:
<INPUT TYPE=text SIZE=35 NAME=first_name VALUE="%s">
<br>\n",$row->first_name);
printf("</br>Last Name:
<INPUT TYPE=text SIZE=35 NAME=last_name VALUE="%s">
<br>\n",$row->last_name);
printf("Email:
<INPUT TYPE=text SIZE=35 NAME=email VALUE="%s">
<br>\n",$row->email);
printf("</br>Address:
<INPUT TYPE=text SIZE=35 NAME=address VALUE="%s">
<br>\n",$row->address);
printf("</br>PhoneNumber:
<INPUT TYPE=text SIZE=35 NAME=PhoneNumber VALUE="%s">
<br>\n",$row->PhoneNumber);
printf("</br>Gender:
<INPUT TYPE=text SIZE=35 NAME=gender VALUE="%s">
<br>\n",$row->gender);
printf("</br>userID:
<INPUT TYPE=text SIZE=35 NAME=userID VALUE="%s">
<br>\n",$row->userID);
printf("<INPUT TYPE=submit VALUE=Modify Name=submit>");
printf("</PRE></form>");
mysql_free_result($result);
}
?>