Humm, it should be ok but try this revised script
<?php
// A 2 dimensional array with the countries...//////////////////////////////////////
$countries_list = array(
54 => 'Afganistan',
65 => 'Albania',
35 => 'Algeria',
68 => 'Andorra',
36 => 'Angola',
35 => 'Algeria',
89 => 'Antigua Barbuda',
20 => 'Australia',
37 => 'Austria',
82 => 'Bahamas',
86 => 'Bangladesh',
85 => 'Barbados',
16 => 'Belgium',
34 => 'Belize',
67 => 'Bosnia Herzegovina',
18 => 'Brazil',
104 => 'Bulgaria',
60 => 'Burkina Faso',
82 => 'Bahamas',
5 => 'Canada',
51 => 'Chile',
8 => 'China',
99 => 'Colombia',
102 => 'Costa Rica',
53 => 'Congo',
97 => 'Croatia',
52 => 'Cuba',
46 => 'Czech Republic',
10 => 'Denmark',
41 => 'Dominican Republic',
103 => 'Egypt',
98 => 'Estonia',
14 => 'Finland',
6 => 'France',
7 => 'Germany',
42 => 'Greece',
43 => 'Guatemala',
33 => 'Hong Kong',
79 => 'Honduras',
74 => 'Hungary',
62 => 'Iceland',
70 => 'India',
44 => 'Israel',
9 => 'Italy',
13 => 'Ireland',
31 => 'Jamaica',
17 => 'Japan',
58 => 'Kiribati',
87 => 'Laos',
101 => 'Latvia',
100 => 'Lebanon',
69 => 'Lithuania',
32 => 'Luxembourg',
40 => 'Malaysia',
25 => 'Mexico',
63 => 'Nauru',
15 => 'Netherlands',
71 => 'Netherlands Antilles',
21 => 'New Zealand',
61 => 'Nigeria',
96 => 'North Korea',
11 => 'Norway',
45 => 'Pakistan',
90 => 'Paraguay',
83 => 'Peru',
59 => 'Philippines',
14 => 'Poland',
24 => 'Portugal',
50 => 'Puerto Rico',
75 => 'Romania',
3 => 'Russia',
47 => 'Serbia',
48 => 'Seychelles',
200 => 'Scotland',
94 => 'Senegal',
26 => 'Singapore',
64 => 'Slovenia',
29 => 'South Africa',
30 => 'South Korea',
23 => 'Spain',
1 => 'Sweden',
57 => 'Switzerland',
49 => 'Taiwan',
93 => 'Thailand',
50 => 'Togo',
78 => 'Trinidad & Tobago',
55 => 'Turkey',
55 => 'Ukraine',
12 => 'United Kingdom',
2 => 'United States of America',
88 => 'Uruguay',
56 => 'Uzbekistan',
73 => 'Venezuela',
77 => 'Vietnam',
39 => 'Western Samoa',
38 => 'Yugoslavia',
);
?>
<?php
// Get the users details from mysql...//////////////////////////////////////////////
$query1 = "SELECT * FROM `membership` WHERE `username`='$member'";
$result1 = mysql_query($query1) or die (mysql_error());
$row = mysql_fetch_array($result1);
$id = $row['id'];
$username = $row['username'];
$email = $row['email'];
$country = $row['country'];
$avatar = $row['avatar'];
$user_class = $row['user_class'];
$ban = $row['ban'];
// if the user is banned no further...//////////////////////////////////////////////
if($ban == "Y") {
echo "<br /><b><h4>This Account Has Been Disabled</h4></b>";
echo "<meta http-equiv=\"refresh\" content=\"1;URL=login.php\">";
include("includes/footer.php");
exit;
}
// check if the user has messages in there inbox.../////////////////////////////////
$query_msg = "SELECT * FROM `pms` WHERE `reciever_id`='$id'";
$result_msg = mysql_query($query_msg) or die (mysql_error());
if (mysql_num_rows($result_msg) > 0) {
echo '<br />
<table border="1" bordercolor="#000000" cellspacing="0" cellpadding="10" bgcolor="red">
<tr>
<td style="padding: 10px; background: red">
<strong><a class="msg_inbox" href="inbox.php">You Have Messages In Your Inbox</a>
</td>
</tr>
</table>';
}
// the POST data.../////////////////////////////////////////////////////////////////
$email_updated = $_POST['email'];
$country_updated = $_POST['country'];
$country = $country_updated;
// isset.../////////////////////////////////////////////////////////////////////////
if(isset($_POST['submit'])) {
// a query to update mysql...///////////////////////////////////////////////////////
$query2 = "UPDATE `membership` SET `email`='$email_updated',`country`='$country_updated' WHERE `username`='$member'";
$result2 = mysql_query($query2) or die (mysql_error());
if($result2) {
echo "<br /><b>Profile Updated Successfully!</b><br /><br />";
}
} else {
// get the id...////////////////////////////////////////////////////////////////////
echo "<br /><h3><p align=\"center\"> Hi, <a href=\"user_details.php?id=$id\">$username</p></a></h3>";
echo '<br />
<table width="400" border="1" bordercolor="#000000" cellspacing="0" cellpadding="3" />
<form action="my_account.php" method="POST" />
<th colspan="2" bgcolor="#004E98"><font color="#ffffff">Edit Your Profile</font></th>
<tr>
<td align="right"><b>Your E-Mail:</b></td><td align="left"><input type="text" name="email" size="30" value="'.$email.'" /></td>
</tr>
<tr>
<td align="right"><b>Select Your Country:</b></td><td align="left">';
$select = '<select name="country" id="country">'."\r\n";
foreach($countries_list as $key => $value) {
$select .= "\t".'<option value="'.$key.'">' . $value.'</option>'."\r\n";
}
$select .= '</select>';
echo $select;
##################################################################
echo '<select name="country">';
foreach ($countries_list as $id => $Item) {
$default = ($Item == $country)?" selected ":"";
echo "<option $default value='$id'>$Item</option>";
}
echo '</select>';
##################################################################
echo '</td>
<tr>
<td align="right"><b>Your Selected Country:</b></td><td align="center">';
## get the flag...////////////////////////////////////////////////////////////
$query3 = "SELECT * FROM `countries` WHERE `id`='$country'";
$result3 = mysql_query($query3);
$row = mysql_fetch_array($result3);
$flag_pic = $row['flagpic'];
echo '<img src="flags/'.$flag_pic.'">';
## get the flag...////////////////////////////////////////////////////////////
echo ' </td>
</tr>
<tr>
<td align="right"><b>Current Avatar:</b></td><td align="center">';
// an if incase theres no avatar...///////////////////////////////////////////
if(empty($avatar)) {
echo "<img src=\"images/default_avatar.gif\" />";
} else {
echo "<img src=\"avatars/$avatar\" />";
}
echo ' </td>
</tr>
<tr>
<td align="right"><b>Upload An Avatar:</b></td>
<td align="left"><a href="upload_avatar.php">Upload Avatar</a></td>
</tr>
<tr>
<td align="right"><b>Change Your Password:</b></td>
<td align="left"><a href="change_password.php">Change Password</a></td>
</tr>
<tr>
<td align="right"><b>Write About You:</b></td>
<td align="left"><a href="about_me.php">About Me</a></td>
</tr>
<tr>
<td align="right"><b>Your Friends List:</b></td>
<td align="left"><a href="friends_list.php">Friends</a></td>
</tr>
<tr>
<td align="right"><b>Your Uploaded Files:</b></td>
<td align="left"><a href="my_files.php">My Files</a></td>
</tr>
<tr>
<td align="right"><b>Your Requests:</b></td>
<td align="left"><a href="my_requests.php">My Requests</a></td>
</tr>
<tr>
<td colspan="2" bgcolor="#004E98" align="right"><input type="submit" name="submit" value="Update Details >>>">
</td>
</tr>
</table></form><br />';
// if the user is a site admin echo a new table out...........................
if($user_class == "Site Administrator") {
echo '<br />
<table width="400" border="0" bordercolor="#000000" cellspacing="0" cellpadding="3" />
<th colspan="2" bgcolor="#004E98"><font color="#ffffff">>>>>>Admin Options<<<<<</font></th>
<tr>
<td align="center"><a href="mass_pm.php">Mass PM All Users</a></td>
</tr>
<tr>
<td bgcolor="#004E98" colspan="2"><font color="#ffffff"><b>>>>>>Admin Options<<<<<</b></font></td>
</tr>
</table><br />';
}
} // end the isset...////////////////////////////////////////////////////////////////////
?>