Submit button not working using html form and php with EasyPHP version 14.1 as pc web server emulation environment -
i using easyphp devserver version 14.1. program, if not familar, emulates webserver on pc. supposed able support php scripts. have created sample html file has radio buttons , submit button. have php script. when load html file in local projects section of easyphp(where html , php files go loaded in php environment) fill in radio buttons , hit submit , nothing happens. can see either there error in html, in php file, or strange going on easyphp.
here html(grade1.html):
<html> <form> <form action="nn.php" method="post"> why don't play poker in jungle?<br> <input type="radio" name="jungle" value="treefrog"> many tree frogs<br> <input type="radio" name="jungle" value="cheetah"> many cheetahs.<br> <input type="radio" name="jungle" value="river"> many rivers.<br>< color sun??<br> <input type="radio" name="a" value="yellow"> yellow<br> <input type="radio" name="a" value="green"> green<br> <input type="radio" name="a" value="purple"> purple<br><br> <input type="submit" name="submit" value="submit"><br> </form> </html>
here php file(nn.php):
<?php if (isset($_post['submit'])) { if (!empty($_post['jungle'])) { if ($_post['jungle']=="cheetah") { $x = 1; } if($_post['jungle']=="treefrog"){$x=0; echo "you selected treefrog answer cheetah\n";} if($_post['jungle']=="river"){$x=0; echo "you selected rive answer cheetah\n";} } else { echo "you did not choose answer jungle.\n"; } if (!empty($_post['sun'])){ if ($_post['sun']=="yellow") {$y=1;} if ($_post['sun']=="green"){$y=0; echo "you selected green answer yellow\n";} yellow\n";} if($_post['sun']=="purple"){$y=0; echo "you selected purple answer yellow\n";} } else { echo "you did not choose answer sun\n."; } } else { echo "please submit form."; } $t = (($x+$y)/2)*100; echo "you made $t"; ?>
when run html file, fill in buttons, , hit submit nothing happens.
thanks
Comments
Post a Comment