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

    Php (link html - get) e codici ASCII strani

    Ciao... ho bisogno di passare col get una stringa, e fin qui nessun problema.

    Funziona, con quasi tutto, ma ho avuto problemi con questo codice ASCI: †

    Come posso fare? Diventa cosi': â€
    -_-"

  2. #2
    Utente di HTML.it L'avatar di flessciato
    Registrato dal
    Jun 2002
    Messaggi
    1,522
    devi settare il chrset della tua pagina. Tutto qui...
    e poi, comunque posta sempre il codice con cui invvi e ricevi con get
    Slack 10 - Apple G5 2.5 - winzoz xp
    php/mysql/apache
    Flash MX / roba in 3D / roba per il video e l'audio

  3. #3
    Allora il link e' cosi':
    http://www.sito.it?variabile=%E2%80%A0ASD

    %E2%80%A0 sembra essere il carattere incriminato.

    Quando poi lo mostro con echo, viene cosi' com'e' anziche' tornare originale (giustamente).

    C'era una funzione per trasformare codici trasformati in link html in stringa originale... ma non la trovo.
    -_-"

  4. #4

  5. #5
    Continua a darmi lo stesso risultato, inoltre leggendo il link che mi hai dato ho trovato piu' sotto:
    A reminder: if you are considering using urldecode() on a $_GET variable, DON'T!

    Evil PHP:

    <?php
    # BAD CODE! DO NOT USE!
    $term = urldecode($_GET['sterm']);
    ?>

    Good PHP:

    <?php
    $term = $_GET['sterm'];
    ?>

    The webserver will arrange for $_GET to have been urldecoded once already by the time it reaches you!

    Using urldecode() on $_GET can lead to extreme badness, PARTICULARLY when you are assuming "magic quotes" on GET is protecting you against quoting.

    Hint: script.php?sterm=%2527 [...]

    PHP "receives" this as %27, which your urldecode() will convert to "'" (the singlequote). This may be CATASTROPHIC when injecting into SQL or some PHP functions relying on escaped quotes -- magic quotes rightly cannot detect this and will not protect you!

    This "common error" is one of the underlying causes of the Santy.A worm which affects phpBB < 2.0.11.
    caribe at flash-brasil dot com dot br
    13-Oct-2003 10:55
    To allow urldecode to work with Brazilian characters as � � � and other just place this header command :

    header('Content-type: text/html; charset=UTF-8');
    -_-"

  6. #6
    Utente di HTML.it L'avatar di gianiaz
    Registrato dal
    May 2001
    Messaggi
    8,027
    in realtà non è una buona idea passare i link in get in effetti...
    comunque per decodificare una stringa che arriva via get la funzione è quella.

    Non è sbagliata quindi la funzione ma il suo utilizzo

  7. #7
    Continua a restituirmi †al posto di †

    Anche guardando il codice html che genera si vede che e' scritto male....
    -_-"

  8. #8

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.