Jump to content

display all available options but restrict update options


adzie

Recommended Posts

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))

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.