Forms problem

Discussion in 'PHP' started by gubak1, Aug 28, 2007.

  1. #1
    Hi!
    I have a form whitch save some datas (for example:

    this is my "first" lection
    Code (markup):

    ) into the mysql database. The problem is that in the MySql databas the following text will be saved:

    this is my \"first\" lection
    Code (markup):
    So my question is:

    How can I avoid
    \"
    Code (markup):
    and save only
    "
    Code (markup):
    ?

    Thanks
     
    gubak1, Aug 28, 2007 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use the stripslashes function
     
    mad4, Aug 28, 2007 IP
  3. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    First you need to see why the slashes are added. You can use get_magic_quotes_gpc(); to see if you have magic quotes on. I recommend having them off and filtering the data as YOU want (e.g., using your database's escape characters before inputting to a db).
     
    Gordaen, Aug 28, 2007 IP