I want make some php test in my form and i've followed a tutorial but i don't get the result i wanted. I want to make sure that the borne's value isn't null. Then send the value to another page "exo.php" to use it.
The problem is when i add the php code inside input's value for example it's not cosindring it as php code but as a string so it prints the php code.
this is my code :
<?php
if (isset($_GET["submit"])) {
$borneErr="";
$borne="";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["borne"])) {
$borneErr = "Missing";
}
else {
$borne = $_POST["borne"];
}
}
}
?>
<form class="" method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" >
<label> Borne : <input type="text" name="borne" value="<?php echo htmlspecialchars($borne);?>">
<span class="error">* <?php echo $borneErr;?></span> </label>
<button type="submit" value="OK"> Send !</button>
</form>
this is the result i get in this image below :