Hi,
After signin in my home page one button is there.i,e update profile.for that i wrote the below code but it will not work.plz tell that what's the problem in my code.[php]
<?php
// Connect database.
$host="localhost"; // Host name.
$db_user="root"; // MySQL username.
$db_password="sreeni"; // MySQL password.
$database="my_db1"; // Database name.
mysql_connect($host,$db_user,$db_password);
mysql_select_db($database);
// Select all data records in table "name_list" and put them into $result.
$result=mysql_query("select * from Registered_Members where user_name='$_GET[user_name]'");
?>
<html><head><title>My Profile</title>
<link rel=StyleSheet href="style.css" type="text/css" media=screen>
<style type="text/css">
#register_panel_a {
float:left;
width: auto;
}
#register_panel_b {
float:left;
width: auto;
}
</style></head>
<body bgcolor=white lang=EN-US link=blue alink=red vlink=purple>
<div align="center">
<h1>MY PROFILE</h1>
<div class="hr_red tiny_top_margin tiny_bottom_margin"></div>
</div>
<br>
<?
// Fetch record rows in $result by while loop and put them into $row.
while($row=mysql_fetch_assoc($result)){
?>
<form><table><tr>
<td>User Name: </td><td><input class="short_width" type="text" value="<? echo $row['user_name']; ?>" ></td>
</tr>
<tr>
<td>Password: </td><td><input class="short_width" type="text"></td><td>Required to update profile</td>
</tr><tr>
<td>New Password: </td><td><input class="short_width" type="text"></td>
</tr><tr>
<td>New Password: </td><td><input class="short_width" type="text"></td>
</tr><tr>
<td>Private Email: </td><td><input class="short_width" type="text" value="<? echo $row['email']; ?>" ></td><td>Registration confirmation, admin. communication.</td>
</tr><tr>
<td>Public Email: </td><td><input class="short_width" type="text"></td><td>Public profile display</td>
</tr><tr>
<td>First Name: </td><td><input class="short_width" type="text" value="<? echo $row['first_name']; ?>" ></td>
</tr><tr>
<td>Last Name: </td><td><input class="short_width" type="text" value="<? echo $row['last_name']; ?>" ></td>
</tr><tr>
<td>Gender: </td>
<td><select name="gender">
<option value="Unspecified">Unspecified
<option value="Male" selected>Male
<option value="Female">Female
</select>
</td>
</tr><tr>
<td>Birth Year: </td><td><input class="short_width" type="text" value="<? echo $row['date_of_birth']; ?>" ></td>
</tr><tr>
<td>Web Page: </td><td><input class="short_width" type="text"></td>
</tr>
<? } // End while loop. ?>
</table>
Personal Statement: <br><textarea rows="5" cols="20">This is my personal statement, blah blah blah...</textarea>
<div class="floatstop"></div>
<input type="submit" value="Update">
</form></body></html>[/php]