Regular Expressions?
| From: | list_php_general at controlaircorp dot com | Date: | Fri, 08 Apr 2005 22:43:02 +0000 |
| Subject: | Regular Expressions? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-212680@lists.php.net to get a copy of this message | ||
Windows 2000 Server
IIS 5/Apache 1.3.33
MySQL 4.1.1
Smarty 2.6.9
PHP 5.0.3
Hi all,
I am looking for help handling a form input to SQL. I believe the solution has to do with regular
expressions.
My big problem is that when a user submits data such as:
Joe's Crabshack
The ' apostrophe or " can cause an early truncation of the data. My code thinks that the
closing identifier is after the word Joe and the rest of the input is lost. Further, if the data
does get by and it could possibly break a SQL statement.
Am I right in thinking the solution in this matter is using regular expressions? If so, where is a
good resource to polish my skills?
What about turning off/on magic quotes?
John