I can't work out why this isn't working. I'm sure it's probably something small but I keep scratching my head. Below are my HTML and PHP.
form.html
<form action="result" method="post">
<input type="text" class="form-control" name="hello">
<input type="submit" class="btn btn-primary" value="Submit">
</form>
result.php (.htaccess is set to allow without .PHP and I receive the same issue when including .PHP in the action)
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
echo "POST<br>";
}
print_r($_POST);
?>
Submitting the form sends you to result.php and POST is displayed, but $_POST
is empty.
EDIT: .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/$ $1 [NE,R=302,L]
Cheers in advance.