php - can't pass value in select option -
this code in test1.php
<?php if ($_post['check']!= ""){ $a = $_post['translation']; } ?> <html> <form action="test2.php" method="post"> <select name="translation"> <option selected="selected" value="1">vietnamese-english</option> <option value="2">english-vietnamese</option> </select> <input type="submit" value="check" name="check"> </form> </html>
and in test2.php echo value $a
nothing. value null when use var_dump($a)
this part of code in form, doesn't belong there:
<?php if ($_post['check']!= ""){ $a = $_post['translation']; // echo $a; // added } ?>
it belongs in test2.php file, why not getting results.
Comments
Post a Comment