79769099

Date: 2025-09-19 03:56:12
Score: 0.5
Natty:
Report link
// 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;
    }
}
?>
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Benyamin Limanto