post - $_POST always empty, $_GET works, php://input works -
i'm working on website using xampp , unfathomable reason, $_post empty, no matter try.
<form id="reg-form" method="post" action="check.php" enctype="application/x-www-form-urlencoded"> <label for="user" form="reg-form">username: </label> <input type="text" id="user" name="user" title="username"> <br /> <label for="pass" form="reg-form">password: </label> <input type="password" id="pass" name="pass" title="password"> <br /> <input type="submit" id="submit" title="submit" value="submit" form="reg-form"> </form>
and here's check.php:
<?php if(empty($_server['content_type'])){ $type = "application/x-www-form-urlencoded"; $_server['content_type'] = $type; } var_dump($_post); print_r($_post); print_r($_get); $data = file_get_contents('php://input'); echo($data); ?>
and output: array(0) { } array ( ) array ( ) user=test&pass=test
if change method get, array gets populated without problems.
i've checked php.ini, post enabled, have gcps in variable_order, post_max_size 8m, tried changing around, didn't help.
i'm @ wit's end , no amount of googling seems help. overlooking simple?
update figured out. using phpstorm , wasn't configured use xampp, using own server-thing instead. once configured properly, suddenly, post working intended. lesson learn: read documentation before using ides.
Comments
Post a Comment