html special character in the when submit form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • weetat.yeo@gmail.com

    html special character in the when submit form

    Hi all ,

    I have a form that allow user to enter description , sometimes the
    description value have html special character for example %20 and etc.

    Inserting into the mysql database is ok , for example the description
    in my table is 'wt%20%20'.

    However . when i have href link which for instance
    '../edit/id=wt%20%20' .

    The mysql database cannot find the id in the table eventhough it
    existed in the table.

    How to overcome this special character issue ?

    Thanks

  • John Dunlop

    #2
    Re: html special character in the when submit form

    weetat.yeo@gmai l.com wrote:
    I have a form that allow user to enter description , sometimes the
    description value have html special character for example %20 and etc.
    >
    Inserting into the mysql database is ok , for example the description
    in my table is 'wt%20%20'.
    >
    However . when i have href link which for instance
    '../edit/id=wt%20%20' .
    >
    The mysql database cannot find the id in the table eventhough it
    existed in the table.
    %20 in a URL path means a space. To use a percent sign as data,
    percent-encode it as %25.

    .../edit/id=wt%2520%2520

    --
    Jock

    Comment

    • Alvaro G. Vicario

      #3
      Re: html special character in the when submit form

      *** weetat.yeo@gmai l.com escribió/wrote (24 Aug 2006 01:14:18 -0700):
      However . when i have href link which for instance
      '../edit/id=wt%20%20' .
      >
      The mysql database cannot find the id in the table eventhough it
      existed in the table.
      Some characters like % have a special meaning in URLs. You must escape any
      text that you add to a URL, just as you do when you insert text into SQL or
      HTML. In this case, the function is rawurlencode().


      --
      -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
      ++ Mi sitio sobre programación web: http://bits.demogracia.com
      +- Mi web de humor con rayos UVA: http://www.demogracia.com
      --

      Comment

      Working...