Re: [PHP] String Validation / SQL Injection Vulnerbilities

2005-12-05 Thread Curt Zirzow
On Mon, Dec 05, 2005 at 02:00:13PM -0500, Michael B Allen wrote: > I want to validate a string for storage into a database so that it cannot > contain any content that might be interpreted as SQL, Javascript, PHP, > etc. Is there a standard function or technique to perform this validation? Trying

RE: [PHP] String Validation / SQL Injection Vulnerbilities

2005-12-05 Thread Jay Blanchard
[snip] I want to validate a string for storage into a database so that it cannot contain any content that might be interpreted as SQL, Javascript, PHP, etc. Is there a standard function or technique to perform this validation? [/snip] The technique is regex (regular expressions), start here http:/

[PHP] String Validation / SQL Injection Vulnerbilities

2005-12-05 Thread Michael B Allen
I want to validate a string for storage into a database so that it cannot contain any content that might be interpreted as SQL, Javascript, PHP, etc. Is there a standard function or technique to perform this validation? Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscrib

Re: [PHP] String validation

2005-02-23 Thread Bostjan Skufca @ domenca.com
> or if you aren't into regex (which I find confusing and still am trying > to learn): Read the book "Mastering Regular Expressions" or first 300 pages of it - trust me, it is worth the labour (personal experience)! On Wednesday 23 February 2005 07:44, Ligaya Turmelle wrote: > > if ((strlen(tr

Re: [PHP] String validation

2005-02-22 Thread Ligaya Turmelle
or if you aren't into regex (which I find confusing and still am trying to learn): if ((strlen(trim($string)) <=6) && ctype_alpha(trim($string))) { echo 'good'; } else { echo 'bad'; } John Holmes wrote: Ashley M. Kirchner wrote: How can I check that a string is no more than 6 characters long

Re: [PHP] String validation

2005-02-22 Thread John Holmes
Ashley M. Kirchner wrote: How can I check that a string is no more than 6 characters long and only contains alpha characters (no numbers, spaces, periods, hyphens, or anything else, just letters.) if(preg_match('/^[a-zA-Z]{0,6}$/',$string)) { echo 'good'; } else { echo 'bad'; } Change to {1,6

[PHP] String validation

2005-02-22 Thread Ashley M. Kirchner
How can I check that a string is no more than 6 characters long and only contains alpha characters (no numbers, spaces, periods, hyphens, or anything else, just letters.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] string validation functions

2003-03-12 Thread Brad Esclavon
trim($a_string); // removes all newline, carriage returns, and formating $in_str_var_name=str_replace("search_for", "replace_with", $in_str_var_name); replaces any strings or chars also- check out php.net documentation on string-- many other useful functions for string manipulation -- PHP G

[PHP] String validation

2001-12-11 Thread Emek TUZUN
How can I check a string variable is based on alphabetical and numerical characters? For ex, I want to make a whois script for domainnames. You may only use alphabetical, numerical characters and dashes ("-") Thanks Emek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-m