Probably a simple question but, I have a form where a user can place a job item, for example. Details of this job are stored in a mysql database. If you can imagine, the user submits a job containing:

he can't wait so he ran...

it would do an insert such as..

insert into jobs values ('he can't wait so he ran'); which is definatly not desierable.

How can you convert special characters into HTML format

ie
he said, "I'LL be back"
==
he+said%2c+%22I%27LL+be+back%22

Is there an easier way round this? Like parse html (what is parsehtml - what does it do)? also, more simple stuff... I want to check if a date matches a certian format (mysql problem again) so I want to check if $date =~ /0000-00-00/ where $date can be like 2000-05-23 (CCYY-MM-DD)

please email me, michael.clarke@ird.govt.nz as I'm new to this site and probably won't be able to find my way bacdk here...


In reply to unpacking - html re-encoding? by Mac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.