I have a form that looks like this:
<form action="/assesment/savelist/" method="post">
<input type="hidden" name="owner" value="<?php echo $userid ?>" />
<input type="text" name="title" value="Question List Title" />
<textarea name="description"></textarea>
<input type="submit" />
</form>
In the description people will have to be able to use the £
character (among other non-allowed characters).
Is there anyway to convert these characters to something that is allowed before posting them to my PHP page?
Hi All, thanks for your comments so far.
If I do print_r($_POST) on my "savequestion" it outposts the postdata that gets sent to it from that form.
however, if there is a £ in any of the fields then that specific character doesnt get sent. For example if I was to post "sdfsdfs £ adasd" from that form all that would get sent is "sdfsdfs adasd"
the question is how do I convert the £ to something that I can send as post data from a HTML form.
htmlspecialchars()
? – Pitt$description = htmlspecialchars($_POST['description']);
although bear in mind that this will convert other characters as well. Personally I'd store everything un-converted, then convert on output. – Metre