PHP is not allowing to enter ' character

Discussion in 'PHP' started by computerzworld, Feb 14, 2008.

  1. #1
    Hello,

    I have one project in PHP which was running on windows server perfectly but when I moved it to linux server it is not allowing me to enter any value with ' anywhere which was running properly on windows server. Now what should I have to do to allow '[\b] on linux server? Please help me. Thanks in advance.
     
    computerzworld, Feb 14, 2008 IP
  2. PhpMaster

    PhpMaster Peon

    Messages:
    48
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What error do you get when trying to enter ' ?
     
    PhpMaster, Feb 14, 2008 IP
  3. mutooni

    mutooni Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi..

    You should be able to escape it using a backslash like this \'
     
    mutooni, Feb 14, 2008 IP
  4. hostydotnet

    hostydotnet Active Member

    Messages:
    355
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    65
    #4
    i think one should go to the web prior to asking questions like this. :eek:
     
    hostydotnet, Feb 14, 2008 IP
  5. hostydotnet

    hostydotnet Active Member

    Messages:
    355
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    65
    #5
    oh yea....and write all of your code for linux....:rolleyes: :) :D
     
    hostydotnet, Feb 14, 2008 IP
  6. Ares

    Ares Member

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #6
    where do you enter ' ?
    if its in the code you should probably try \' .
    if not , and you are entering it in textbox try this one and put it in a header file or something .
    
    foreach ($_GET as $k => $v) {
          
             $_GET[$key] = addslashes(trim($v));
          }
          
    foreach ($_POST as $k => $v) {
          
             $_POST[$key] = addslashes(trim($v));
          }
    
    PHP:
     
    Ares, Feb 14, 2008 IP
  7. computerzworld

    computerzworld Active Member

    Messages:
    214
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #7
    i got the solution for this and the solution is in the php.ini magic_quotes_gpc = Off which I turned on and it worked!!:)
     
    computerzworld, Feb 17, 2008 IP
  8. 00johnny

    00johnny Peon

    Messages:
    149
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    ohhhhhhhhhhhh magic quotes is source / root of all evil!! I always turn off at beginning of every project. I've gotten a few bald spots because of it.
    magic_quotes_gpc should be default off!
     
    00johnny, Feb 18, 2008 IP