SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    unwanted caracters

    Hi ALL,

    I believe this will be a tiny problem to you guys. At least I hope so...
    I have integrated TinyMCE into my site for creating some html files. I think the problem is with the way my PHP script saves the textarea content :

    PHP Code:
    $text    trim($_POST['text']); // text is the textarea with HTML content such as images, links, etc

    $message "<html>
    <head>
    <title>
    </title>
    </head>
    <body>"
    .$text."</body>
    </html>"

    Now, when I save the file the HTML code looks like :

    Code:
    <html>
    <head>
    <title>
    </title>
    </head>
    <body><p>Some text here</p>
    <p><img src=\"http://www.domain.com/graphics/banner_11.jpg\" alt=\"\" width=\"850\" height=\"180\" /></p>
    <p><a href=\"http://www.somedomain.com\">Link label</a></p></body>
    </html>
    You can see the 'extra' \ character which causes problems.... how can I get rid of them?

    Thanks in advance!
    Regards

    Full time ADMIN - art community
    Part time coder - dsign

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    magic_quotes_gpc is likely the cause
    http://www.php.net/magic_quotes

  3. #3
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you crmalibu, it was the stripslashes function
    http://www.php.net/manual/en/function.stripslashes.php

    Full time ADMIN - art community
    Part time coder - dsign


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
  •