// You can't use opened text then another opened text
<?php
// something
//then another
<?php
You should
<?php
// something
?>
<?php
// another things
?>
So the best approach is : (online - https://3v4l.org/jlrdA#v8.4.12)
<?php
if (!isset($_POST["password"])) {
$target = htmlspecialchars($_SERVER['PHP_SELF'] ?? "");
$form = '<html><head><title>testing</title></head><body><form action="'.$target.'" method="post"><input type="password" name="password"></form></body></html>';
echo($form);
} else {
if ($_POST["password"] === "TestersAndDevs0nly") {
session_start();
$_SESSION["logged"] = true;
}
}
?>