salve a tutti, premetto che sono ai primi passi della programmazione php e non riesco a risolvere un problema in uno script di prova. Il codice è :
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div>
<form action="<?php echo htmlentities($_SERVER['PHP_SELF']);?>" method='post'>
<p>numero m
<input type="number" name="numberm" required></p>
<p>numero n
<input type="number" name="numbern" required ></p>
<p>testo
<textarea name="testo" cols="20" placeholder="scrivi qui il tuo commento" maxlength="30"> </textarea> </p>
<p>
<input type="submit" name="submit" value="vai"> </p>
</form>
</div>
<?php
class validacion {
var $numberm;
var $numbern;
var $testo;

function validando(){
if (isset($_POST['submit'])){
if ($_SERVER["REQUEST_METHOD"] === "POST"){
$this->numberm= $_POST['numberm'];
$this->numbern= $_POST['numbern'];
$this->testo= $_POST['testo'];
}
else {
echo "si vede l'else";
}
echo $this->numberm .'</br>'. $this->numbern . '</br>';
echo $this->testo;

}
}
}
$escritor=new validacion();
$escritor->validando();
?>
</html>

come si vede è molto banale ma quando nel testo includo il simbolo maggiore o minore (<>) dopo il submit mi cancella questi simboli e anche tutto quello che è dentro e anche quello che li stà attaccato. Sembrarebbe che htmlentities() non funziona o forse l'html lo taglia dall'inizio. Ringrazierò qualsiasi aiuto.