|
Posted by purcaholic on 05/21/07 20:22
On 21 Mai, 19:17, damezumari <jannordgr...@gmail.com> wrote:
> // trim the parameters
> foreach($_POST as $varname => $value) {$varname = trim($value);}
>
> // give them $p_ prefix
> import_request_variables('gp', 'p_');
>
> When I do the above the parameters are not trimmed in the end.
>
> Example:
>
> $lastname = ' ' is trimmed to $lastname = '', but $p_lastname = ' '
The first line, where you loop post array will not update post
content, it assigns trimmed value to $varname.
When using foreach loop using $varname => $value, $varname holds a
copy of actual key and $value the copy of actual value.
You have update post array directly, like
[snip]
foreach($_POST as $varname => $value) {$_POST[$varname] =
trim($value);}
[/snap]
purcaholic
Navigation:
[Reply to this message]
|