Re: $request problem
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: $request problem

From: Richard Levasseur <richardlev@gmail.com>
Date: Sat Mar 11 2006 - 02:23:14 CET

Not quotes a string index generates an E_NOTICE or something, i forget
which exactly, normally error reporting isn't set to show it. PHP
tries to resolve it as a define()'d constant, then treats it as a
quoted string. Not quoting the string index is generally bad form.

Single quotes provide a small performance gain as php doesn't try to
interpret the string.

For the question at hand:
I'm fairly sure that the callback has to be quoted, when using array
map, that may be the problem. Why are you individually escaping each
'word' of the input? Wouldn't it be easier to just apply it to the
entire $_REQUEST['input'] string?

$queries = array_map( 'mysql_real_escape_string', explode(" ",
$_REQUEST["input"]));
Received on Mon May 1 02:31:05 2006