SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2004
    Location
    Birmingham, AL
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Code in text fields

    I am having problems locating the proper prefix to my text strings when I save them and when i load them. I have 2 files:
    editevent.php
    doeditevent.php

    When you click a like from the main page, it takes you to the "editevent.php" page for that event. It then loads 3 fields (date, name, and description). I have tried stripslashes, but this doesn't do anything. I tried strip_tags, and this allows all the text to pull up, however if there are any links in the text, it takes those out as well. Furthermore, when I do the form action file (doeditevent.php), i've got each field setup with nl2br as a prefix so each line break ends up in a <br>.

    I am very new to PHP and need some help figuring out the best way to load the text exactly as it is in the database, and also saving it so it maintains the proper look. I'm thinking of going to a WYSIWYG editor, but all those buttons and everything would look kind of dumb for a 1 lined string.

    Please help! Thanks.

  2. #2
    SitePoint Evangelist Aska's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    htmlspecialchars may be what you needed.


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
  •