Кодировки

Discussion in 'PHP' started by kdk, 10 Nov 2009.

  1. kdk

    kdk Elder - Старейшина

    Joined:
    8 Nov 2006
    Messages:
    112
    Likes Received:
    5
    Reputations:
    -3
    CILL

    CILL
     
    #1 kdk, 10 Nov 2009
    Last edited: 11 Nov 2009
  2. Pashkela

    Pashkela Динозавр

    Joined:
    10 Jan 2008
    Messages:
    2,750
    Likes Received:
    1,044
    Reputations:
    339
    $FIO=$_POST['FIO'];
    $FIO = iconv...
     
  3. mailbrush

    mailbrush Well-Known Member

    Joined:
    24 Jun 2008
    Messages:
    1,997
    Likes Received:
    996
    Reputations:
    155
    Кстати, не советую тебе юзать такой запрос в БД:
    PHP:
    $FIO=$_POST['FIO']; 
    ...
    $zapros="SELECT * FROM `$FIO`";
     
  4. kdk

    kdk Elder - Старейшина

    Joined:
    8 Nov 2006
    Messages:
    112
    Likes Received:
    5
    Reputations:
    -3
    zapros='INSERT INTO `gb` ( `FIO` ) VALUES ('$FIO');
     
  5. b3

    b3 Banned

    Joined:
    5 Dec 2004
    Messages:
    2,170
    Likes Received:
    1,155
    Reputations:
    202
    PHP:
    $zapros 'SELECT * FROM `'.addslashes($_POST['FIO']).'`';
     
  6. mailbrush

    mailbrush Well-Known Member

    Joined:
    24 Jun 2008
    Messages:
    1,997
    Likes Received:
    996
    Reputations:
    155
    PHP:
     $zapros 'SELECT * FROM `'.mysql_real_escape_string($_POST['FIO']).'`'
    Вот так правильнее всего.
     
  7. kdk

    kdk Elder - Старейшина

    Joined:
    8 Nov 2006
    Messages:
    112
    Likes Received:
    5
    Reputations:
    -3
    СПС попробую
     
  8. mailbrush

    mailbrush Well-Known Member

    Joined:
    24 Jun 2008
    Messages:
    1,997
    Likes Received:
    996
    Reputations:
    155
    Работать будут все три варианта, вопрос заключается в том - долго ли они проработают? :)

    Если ты еще не понял, скажу прямо - в твоем варианте SQL - инъекция.
     
  9. kdk

    kdk Elder - Старейшина

    Joined:
    8 Nov 2006
    Messages:
    112
    Likes Received:
    5
    Reputations:
    -3
    CILL