Don holio's Gravatar Don holio's Profile

About Me:

Last 10 Comments

1

Chris... Nice post but why not use a regex before using addslashes()?

if(!erg('^[[:graph:][:space:]]*$', $string){ exit();}

This would only allow for whitespace and printable characters found in the range of ASCII 33 to 126 (punctuation and alphanumerics).

i.e.

$string = $_POST['$string'];

if(!erg('^[[:graph:][:space:]]*$', $string){ exit();}

$string = addslashes($string);

or why don't you just stick with mysql's default charset setting UTF-8? Please, correct me if i'm wrong.

Posted in /blog/2006/jan/addslashes-versus-mysql-real-escape-string.

Sat, 07 Mar 2009 at 16:34:48: Link


Stats

  • Member Since: 07 Mar 2009
  • Comments: 1

Web Site

claimid.com/don_holi

Blog Posts


Work and Books

Analog Essential PHP Security HTTP Developer's Handbook