Double quotes in text input

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob

    Double quotes in text input

    I accept text, add_slashes, and store it in my MySQL DB. When I display
    the text, I normally strip_slashes and also strip_tags. This all works
    excepts for a field with double quotes. e.g.

    "My Book's Title" is very simple

    When I display this field, it is totally blank. What's the solution?

  • Kimmo Laine

    #2
    Re: Double quotes in text input

    "Bob" <bobr@whidbey.c omwrote in message
    news:1161307446 .321192.22730@i 42g2000cwa.goog legroups.com...
    >I accept text, add_slashes, and store it in my MySQL DB. When I display
    the text, I normally strip_slashes and also strip_tags. This all works
    excepts for a field with double quotes. e.g.
    >
    "My Book's Title" is very simple
    >
    When I display this field, it is totally blank. What's the solution?
    I suppose html_entities(" My Book's Title"); would do the trick.

    If you have an input like <input type="trext" value=""My Book's Title"", the
    html parser assumes the value="", empty quotes, thus the totally blank input
    field.

    --
    "Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
    http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
    spam@outolempi. net | rot13(xvzzb@bhg byrzcv.arg)


    Comment

    • Bob

      #3
      Re: Double quotes in text input


      Kimmo Laine wrote:
      "Bob" <bobr@whidbey.c omwrote in message
      news:1161307446 .321192.22730@i 42g2000cwa.goog legroups.com...
      I accept text, add_slashes, and store it in my MySQL DB. When I display
      the text, I normally strip_slashes and also strip_tags. This all works
      excepts for a field with double quotes. e.g.

      "My Book's Title" is very simple

      When I display this field, it is totally blank. What's the solution?
      >
      I suppose html_entities(" My Book's Title"); would do the trick.
      >
      If you have an input like <input type="trext" value=""My Book's Title"", the
      html parser assumes the value="", empty quotes, thus the totally blank input
      field.
      Thanks Kimmo - you explained the problem AND found the solution.
      htmlentities worked!

      Comment

      • Bob

        #4
        Re: Double quotes in text input


        Kimmo Laine wrote:
        "Bob" <bobr@whidbey.c omwrote in message
        news:1161307446 .321192.22730@i 42g2000cwa.goog legroups.com...
        I accept text, add_slashes, and store it in my MySQL DB. When I display
        the text, I normally strip_slashes and also strip_tags. This all works
        excepts for a field with double quotes. e.g.

        "My Book's Title" is very simple

        When I display this field, it is totally blank. What's the solution?
        >
        I suppose html_entities(" My Book's Title"); would do the trick.
        >
        If you have an input like <input type="trext" value=""My Book's Title"", the
        html parser assumes the value="", empty quotes, thus the totally blank input
        field.
        Thanks Kimmo - you explained the problem AND found the solution.
        htmlentities worked!

        Comment

        Working...