Characters Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ziycon
    Contributor
    • Sep 2008
    • 384

    Characters Issue

    I have a textarea and when i add content to the DB say:
    #hello&again
    It will ad fine, but if i query that string from the DB and place it in a textarea to be edited and save it, anything after and including the & is removed, this seems to happen with & and ; characters. These are the only to i've come across so far, can't seem to figure it out!??
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    Not 100% sure but do you have magic_quotes on? Do you strip/add slashes?Can you use html replacements?

    Comment

    • ziycon
      Contributor
      • Sep 2008
      • 384

      #3
      magic_quotes is turned off in the htaccess file and strip slashes is being used!?

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        With HTML & has a special use. Change it to it's entity equivalent (&)

        Comment

        • ziycon
          Contributor
          • Sep 2008
          • 384

          #5
          That will just give the same problem because the two characters causing the problem are bout in it & and ;!?!

          Comment

          • TheServant
            Recognized Expert Top Contributor
            • Feb 2008
            • 1168

            #6
            What is your database saving it as? If you have MyPHPAdmin or something to view your database values, see if "&" and ";" characters are being stored there. If so, then it is your database output script that we need to look at, otherwise it is the input.

            Comment

            • ziycon
              Contributor
              • Sep 2008
              • 384

              #7
              Ok, i've tested it and this is how it is stored:

              I create a new article on the site with the & symbol and it saves to the database, it shows up in the database as & and then when i edit the article on the website it outputs the symbol & but it removes it when saving from the edit!?

              Comment

              • TheServant
                Recognized Expert Top Contributor
                • Feb 2008
                • 1168

                #8
                Well I guess the obvious question is: does the edit get processed the same way as the new form? I imagine no which is why there is a difference. Can you post any differences between how those two forms are handled?

                Comment

                Working...