Jump to content

[SOLVED] pulling value


Recommended Posts

I have an edit page that I am trying to make pull the default selection but I am a little lost. I know that I need to do a $_GET['level'] but I don't know how/where to do it.


Here is what I have.


Being passed on the URL




On the page


<td>Access Level:</td>
  <select name="access" class="required">
   <option value="2">Officer</option>
   <option value="1">Manager</option>
   <option value="3">Other</option>

Link to comment
Share on other sites

I have a team_review page that lists everyone from a database. Next to there name is a delete and edit button. When you click edit, this information is passed to the url and it opens the team_edit page.




On the edit page it has fields that can be edited. aka








The Level is a <select> with three options

<option value="2">Officer</option>

<option value="1">Manager</option>

<option value="3">Other</option>


What I want it to do is when they/I click edit for it to auto select the option depending on the value... in this case 2... selected

Link to comment
Share on other sites

It didn't like this


echo "<option value=\"2\"";
if($_GET['level'] == 2){echo " selected ";}
echo ">"Officer"</option>";}
else if
if($_GET['level'] == 1){echo " selected ";}
echo ">"Manager"</option>";}
if($_GET['level'] == 3){echo " selected ";}
echo ">"Other"</option>";}

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.