|
Posted by Dave on 11/05/10 11:16
Joe Blow (Joe@Blow.com) decided we needed to hear...
> Two questions late at night and going stir crazy. Anybody who takes pity on
> me will have my undying gratitude and a virtual bottle of beer.
> I've tried to look them both up on the php.net, and elsewhere, but without
> success.
>
> 1. Am writing a php program which checks entries in a form on a previous
> page. It then asks for any empty fields to be filled, and submits the
> resulting form back to itself to check it again.
>
> In other words the file "checkblank.php" includes this line within the php:
>
> echo "<form target=\"checkblank.php\" method=\"post\">";
instead, use...
echo "<form action='checkblank.php' method='post' target='_self'>";
>
> When the form is submitted it opens in a new window (in FireFox). In Firefox
> it is not a disaster as the variables and arrays are not lost, and the
> program works, but popups are not something I like. In IE the whole thing
> collapses in a heap as the variables appear not to be passed to the new
> window. Needless to say, the vast majority of users will have IE. Is there a
> reason I'm unaware of, and can it be stopped easily?
>
> 2. Can anybody suggest a quick and easy way to strip arrays? stip_tags is
> fine with variables, but converts arrays to variables. I'd like to use it
> for the sake of security though. I don't particularly want to translate the
> array into a whole lot of variables, as it's a big array.
something like...
foreach (array_keys($array_to_strip) as $akey) {
$array_to_strip[$akey] = strip_tags($array_to_strip[$akey]);
}
or use array_walk or array_walk_recursive
--
Dave <dave@REMOVEbundook.com>
(Remove REMOVE for email address)
[Back to original message]
|