Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [PHP5] filter_input e accentate :(

    Ciao.
    C'è qualcuno che mi spiega perchè se si
    mette delle lettere accentate questo esempio
    non funziona (funziona solo con FILTER_SANITIZE_STRING)
    mentre in tutti gli esempi nel web è consigliato
    l'uso di FILTER_SANITIZE_STRING,FILTER_FLAG_ENCODE_HIGH|FIL TER_FLAG_ENCODE_LOW

    Esempio provare per credere

    Codice PHP:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body>
    <?php 
    if(filter_has_var(INPUT_POST'due')){
    $name filter_input(INPUT_POST'uno',FILTER_SANITIZE_STRING);
    echo 
    'FILTER_SANITIZE_STRING :'.$name.'
    '
    ;
    $name filter_input(INPUT_POST'uno',FILTER_SANITIZE_STRING,FILTER_FLAG_ENCODE_HIGH|FILTER_FLAG_ENCODE_LOW);
    echo 
    'FILTER_SANITIZE_STRING,FILTER_FLAG_ENCODE_HIGH|FILTER_FLAG_ENCODE_LOW :'.$name.'
    '
    ;
    $name filter_input(INPUT_POST'uno',FILTER_SANITIZE_STRING,FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH);
    echo 
    'FILTER_SANITIZE_STRING,FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH :'.$name.'
    '
    ;
    }
    ?>
    <form action="test.php" method="post">
    <input name="uno" type="text">

    <input name="due" type="submit" value="send">
    </form>
    </body>
    </html>


    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  2. #2
    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.