Guest User

Untitled

a guest
Dec 12th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. (isset($_POST["company"])) ? $company = $_POST["company"] : $company=1;
  4.  
  5. ?>
  6.  
  7. <form>
  8. <select id="company" name="company">
  9. <option <?php if ($company == 1 ) echo 'selected' ; ?> value="1">Apple</option>
  10. <option <?php if ($company == 2 ) echo 'selected' ; ?> value="2">Samsung</option>
  11. <option <?php if ($company == 3 ) echo 'selected' ; ?> value="3">HTC</option>
  12. </select>
  13. </form>
Add Comment
Please, Sign In to add comment