html - Unable to display sum of data in PHP -


i using following environment:

php version 5.6 apache 2.4 o.s windows 10.

following code form , php script handles form submission. when submit form blank page. doesn't print "total:". also, if remove isset condition, following error:

"notice: undefined index: value1 in f:\small php projects\addnnum.php on line 5"

"notice: undefined index: value2 in f:\small php projects\addnnum.php on line 6"

addnum.html

<!doctype html> <html>     <title>php - add 2 numbers</title>     <body>         <form action="addnnum.php" method="post">             <input type="number" name="value1" value="0" />             <input type="number" name="value2" value="0" />             <input type="submit" name="submit" value="calculate values"/>         </form>     </body> </html> 

addnnum.php

<?php echo "test";  if (isset($_post['submit'])) {     $value1 = $_post['value1'];     $value2 = $_post['value2'];     $sum    = $value1 + $value2;      echo "total :" . $sum; } ?> 

i found reason issue. seems issue in php storm version 10.

i have uninstalled ver 10 , installed ver 9. works ok. here's link

https://intellij-support.jetbrains.com/hc/en-us/community/posts/206999125-phpstorm-10-does-not-allow-post-method

hope helps..


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -