Well this is strange but my form is not passing POST data.
Here is the form
<form method="POST" action="process/processor.php">
<input name="name3" type="text">
<input type="submit" name="submit">
</form>
Here is the PHP
<?php
if(isset($_POST['submit']) AND $_SERVER['REQUEST_METHOD'] == "POST"){
$name = $_POST['name3'];
echo $name;
}
else{
echo 'lol';
}
?>
Here is where it gets surprising
var_dump($_POST)
gives array(0) { }
on the other hand, var_dump($_GET)
gives rray(2) { ["name3"]=> string(6) "fghjmk" ["submit"]=> string(6) "Submit" }
It looks like i'm getting data with GET
and no data with POST
. This is quite strange to me. Any suggestions?
And nothing is echoed out for variable $name