phpposthttp-posthttp-post-vars

Post method not working in PHP


I've tried some other posts, but never made it.

My php form inside html file is :

<form action="test.php" method="POST">
VAR:<input type="text" name="var"><br>
<input type="submit">
</form>

I'm receiving the variable in test.php as <br>

$_POST['var'] ---- > doesn't work! <br>

Tried, $_REQUEST['var'] ----> doesn't work!

I tried the form using get request, it works like a charm on the other end at test.php by using both $_GET['var'] and $_REQUEST['var'] Any way I can parse the request in the form of post request from that form to test.php ..

Appreciate the help! Thanks.


Solution

  • Updated to PHP 7.0 and it's working now!

    Thanks everyone for their help!