Hello,

I'm attempting to make a function to which I can pass
my form variables, to wit:

clean_input($HTTP_POST_VARS);

which will run through the array and clean up the
variables. However, the passing by reference is giving
me the screaming fits. No matter what I do, I can't
seem to get the function to alter the actual array,
and not a copy of it. I tried it with arraywalk(), but
that produces a copy of the array, so I'm trying
each() and list() like this:

function clean_input(&$form_vars)
{
   reset($form_vars);
   while ($element = each($form_vars))
   {
      trim(strip_tags(stripslashes($element[1])));
   }
}

but this just makes another copy. HTTP_POST_VARS still
contains the ugly, raw input. Putting an "&" in front
of $element in the while loop caused the script to
crash. I know there should probably be another "&"
somewhere, but I can't figure out where. Any help
would be appreciated!

-bryan

=====
---------------------------------------------------------------------------
Schrodinger may have slept here.
---------------------------------------------------------------------------

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to