|
Posted by Rik on 08/04/07 18:06
On Sat, 04 Aug 2007 18:25:41 +0200, Big Moxy <bigmoxy@gmail.com> wrote:
> The while statement shows that the variable phrase is null. However
> the if statements that follow return true because 3 table rows are
> created on my page.
> value=3D"^^no^^" name=3D"logo" value=3D"296.06" name=3D"part_sell_pric=
e"
> value=3D"" name=3D"phrase" value=3D"script" name=3D"font_type" value=3D=
"386"
> name=3D"thread_color" value=3D"^^no^^" name=3D"nomex" value=3D"Next >>=
"
> name=3D"Submit"
>
> <?php
> session_start();
> foreach ($_POST as $key =3D> $value) {
> $_SESSION[$key] =3D $value;
> }
>
> while (list($name, $value) =3D each($HTTP_POST_VARS))
please use the same construct as before (foreach($_POST as...)), as =
relying on $HTTP_POST_VARS is hopelessly outdated.
> {
> echo "value=3D\"$value\" name=3D\"$name\"\n";
> }
Which will show you nothing about the NULL status. NULL is a strange =
beast, an empty string ('') or false will also print nothing to your =
screen, doesn't mean it is NULL. All values arrived by a POST are a stri=
ng =
by default, and a string cannot be NULL, it can be empty though, not the=
=
same thing. NULL is actually a type of it's own (next to strings, =
booleans, integers, floats etc.).
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|