I'm writing a webpage, and am trying to use php to check a value after a form submits. The php is in the same page, as seen below. The $_POST variable is coming in empty after the submit code comes in though. I've looked at the other posts about this question but none of those answers seem to help. Thanks for looking
<?php
session_start();
require_once 'assets/PHP/membership.php';
$membership = new Membership();
var_dump($_SESSION);
var_dump($_POST);
if($_POST && !empty($_POST['username']) && !empty($_POST['pwd']))
{
$response = $membership->validate_user($_POST['username'], $_POST['pwd']);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<div id="login">
<form method="post" action = "">
<h2>LOG IN:</h2>
<label>User Name :</label>
<input type="text" name="username" id = "username"/>
<label>Password :</label>
<input type="password" name="pwd" id = "pwd"/>
<input type="submit" value="Login" id="submit" name="submit"/>
</form>
</div>
</html>
I'm very new to HTML and PHP so any help I could get would go a long way.