adzie Posted August 8, 2008 Share Posted August 8, 2008 Hello Folks, I need to display the users correct level (levels 1-7) but would like to restrict any updates to just 1 and 2. So the script will show the users actual level and the drop down shows all levels but only levels 1 and 2 update when saved to the db. I have included all the bits that I currently have and as always would appreciate any guidance you guys can provide. many thanks my current code { if($row['level'] == 1) { $start = "selected"; } elseif($row['level] == 2) { $50 = "selected"; } elseif($row['level'] == 3) { $100= "selected"; } elseif($row['level] == 4) { $150 = "selected"; } elseif($row['level'] == 5) { $200 = "selected"; } elseif($row['level'] == 6) { $supervisor = "selected"; } elseif($row['level] == 7) { $admin = "selected"; } } and <td align=right><p>level</td><td><select name=\"rank\"><option value=1 ".$start.">start</option><option value=2 ".$50.">50</option><option value=3 ".$100.">100</option><option value=4 ".$150.">150</option><option value=5 ".$200.">200</option><option value=6 ".$supervisor.">supervisor</option><option value=7 ".$admin.">admin</option></select></p></td> and $sql="UPDATE members SET level='".$_POST['level']."' where member_ID='".$_POST['id']."'"; if(mysql_query($sql,$conn)) Link to comment https://forums.phpfreaks.com/topic/118859-display-all-available-options-but-restrict-update-options/ Share on other sites More sharing options...
adzie Posted August 9, 2008 Author Share Posted August 9, 2008 any thoughts? Link to comment https://forums.phpfreaks.com/topic/118859-display-all-available-options-but-restrict-update-options/#findComment-612266 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.