Simple PHP help (I think)

Discussion in 'PHP' started by GFX^^, Mar 27, 2007.

  1. #1
    I get this when running a script:

    Fatal error: Call to undefined function escape_data() in /home2/estebanp/public_html/autos/registracion.php on line 20

    on line 20:
    $usuario = escape_data($_POST['usuario']);

    PLS Help me :D

    Thanks
     
    GFX^^, Mar 27, 2007 IP
  2. Robert Plank

    Robert Plank Peon

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You are trying to call a function named "escape_data" that isn't there... maybe you forgot to include a file that has the function?
     
    Robert Plank, Mar 27, 2007 IP
  3. GFX^^

    GFX^^ Well-Known Member

    Messages:
    1,421
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    168
    #3
    Isn't it a function that comes with php?
     
    GFX^^, Mar 27, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    There's not PHP function called like that...
     
    nico_swd, Mar 27, 2007 IP
  5. aaron_nimocks

    aaron_nimocks Im kind of a big deal Staff

    Messages:
    5,563
    Likes Received:
    627
    Best Answers:
    0
    Trophy Points:
    420
    #5
    Ya I just looked it up and its not a built in fuction.
     
    aaron_nimocks, Mar 27, 2007 IP
  6. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you are dealing with data to be placed in an mysql query, you might want to look at the php functions:

    mysql_real_escape_string() or mysql_escape_string()
     
    clancey, Mar 27, 2007 IP
  7. amitpatel

    amitpatel Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    escape_data() is the not inbuilt function. so perhaps you are not defined the
    function definition in the your script in registeration.php?
     
    amitpatel, Mar 28, 2007 IP
  8. weknowtheworld

    weknowtheworld Guest

    Messages:
    306
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hi,

    I think you don't want to allow unwanted characters in the data hence, please use mysql_real_escape_string() as:

    $usuario = mysql_real_escape_string($_POST['usuario']);
     
    weknowtheworld, Mar 28, 2007 IP
  9. Zeh.Trader

    Zeh.Trader Peon

    Messages:
    80
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    try reuploading registracion.php
     
    Zeh.Trader, Mar 29, 2007 IP
  10. niteowl660

    niteowl660 Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #10
    You can try one of the following depending on you script needs
    mysql_real_escape_string()
    addslashes()
     
    niteowl660, Mar 29, 2007 IP