SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    TEXT AREAS - and quotes

    asome people have been posting quotes in text areas. These seem to be affected by html. When they are translated they appear to have slash marks in front of quotes and apostrophes. eg \

  2. #2
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <textarea><?php echo stripslashes(htmlentities($var)); ?></textarea>
    my mobile portal
    ghiris.ro

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    stripslahses() is a bad idea. that fact that you need them means your strings are being escaped too many times before being inserted in to the database. for example, you have magic_quotes() turned on and you're using mysql_real_escape_string(). you should disable magic_quotes(), make sure you're escaping all of your strings with only one pass of mysql_real_escape_string(), and then go and fix all of your previously inserted strings.

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The info is been stored in text files not databases.

  5. #5
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then if you have not sorted out the problem yet, the stripslashes() will be fine for you. But if you want to long term solution for this and you can change the magic_quotes turn off, go for this.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •