#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    14
    Hi,

    I have a script like formmail that takes user input and emails it. The problem is that when the user enters quotes ie: "word" it prints like this "word" is there way to just print: "word"

    Thanks for your help!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Ontario, Canada
    Posts
    498
    Rep Power
    18
    use StripSlashes() around the variable with the backslashed quotes. This removes the slashes, so it displays text "word" as "word". Also, you could mess around with MAGIC_QUOTES_GPC stuff, if you don't want to use StripSlashes().

    ------------------
    To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    14
    Hi,

    Thanks for the help. The variable is comes from a text area form and is called: $Body_Text so would I go:

    StripSlashes($Body_Text) ?

    Thanks!
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    27
    Rep Power
    0
    Writing:
    StripSlashes($Body_Text)

    ...is fine, as long as you do that in the part of your form that is responsible for sending the message (ie: " mail($blah, $blah, StripSlashes($Body_Text)); ").

    It's safer to write:
    $Body_Text = StripSlashes($Body_Text);
    ...before you must use the variable; that way, your variable has the slash-less value stored in it (the first example does not change the value of your var).

    =)
    //ryan
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    14
    Hi,

    I tried this:

    $Body_Text = StripSlashes($Body_Text);

    and I get this:

    for example "test" it displays like just two backslashes.

    Any thoughts?

IMN logo majestic logo threadwatch logo seochat tools logo