1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <?php
header('Content-Type: text/html; charset=utf-8');
if (!empty($_POST['nom_user'])) {
echo 'La variable est '.$_POST['nom_user'];
echo ' et à une longueur de '.mb_strlen($_POST['nom_user'],'utf-8').' caractères.';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</title>
</head>
<body>
<form method="post" action="#">
<label for="nom_user">Votre variable:</label> <input type="text" name="nom_user" size="35"/>
<input type="submit" name="ok" value="ok"/>
</form>
</body>
</html> |