html - Retrieve post value from php of dropdown select upon page -


i have drop down select inside of form on page nice.php submitted using button

<form action="nice.php" method="post"> <select name="carlist"> <option value="0"> - select car - </option> <option value="am">aston martin</option> <option value="kg">koenigsegg</option> <option value="mb">mercedes benz</option> </select>  <input type="submit"> </form> 

after making selection possible submit form, reload same page value dropdown php variable $selectedcar?

if(!empty($_post['carlist'])){     $selectedcar = $_post['carlist'];     echo $selectedcar; }else{     echo '<p>no selection has been made , submitted yet</p>'; } 

Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

how to receive file in java(servlet/jsp) -