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
Post a Comment