Issue validating apostrophe in a form
Hi,
I am having an issue validating apostrohpes in a form. Naturally the form works without validation and apostrophes are inserted into the database and displayed correctly. However, as soon as I add validation using alphanumeric and add '?!@ as other characters which I allow, the form returns the following:
user types: it's amazing
Form reloads to show errors with validation: it\'s amazing
To counteract the validation show issue when the existing form reloads, I have used stripslashes so that the \ does not show BUT the apostrophe simple won't take.
I have also tried adding the following at line 1 of my page but the problem persists:
<?php
ini_set('magic_quotes_gpc','on');
?>
Incidentally, php.net say Warning: This feature has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
I am almost at the point of removing the alphanumeric validation but I know this is bad practise.
Any ideas?
Tom