quindi così ?

Codice PHP:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
</head>

<?php
if (isset($_POST['invia'])) {
// recupera il campo "testo": 
$box = ((isset($_POST['testo']))?($_POST['testo']):(false)); 
// toglie spazi e rende tutto minuscolo (accetta, p.es., anche "Scacco Matto"): 
$box strtolower(str_replace(' '''$box)); 
// pagina di redirezionamento generica: 
$redir 'scemo.php'
// in caso di inserimento del testo voluto cambia la pagina generica: 
if ($box == 'scacco matto'$redir 'bravo.php' 
// redirezionamento: 
header("location: $redir);exit;
}; 
?>

<body> 
<form action="
script.php" method="post">  
  <input type="
text" name="testo">
   
  <input type="
reset" name="cancella" value="cancella" />  
  <input type="
submit" name="invia" value="invia" />   
</form> 
</body>

</html>