I have a website, to test the login functionality, I made a testing.php file. Here is the code:
<?php
if (!isset($_POST["password"])) {
$form = "<html><head><title>testing</title></head><body><form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="post"><input type="password" name="password"></form></body></html>";
echo($form);
} else {
if ($_POST["password"] === "TestersAndDevs0nly") {
session_start();
$_SESSION["logged"] = true;
}
}
?>
but when I execute it i get this error:
Parse error: syntax error, unexpected string content “”, expecting “-” or identifier or variable or number
I tried putting in it a variable, but it returned the error still.