You are here: Re: Newbie has more is_null woes « PHP Programming Language « IT news, forums, messages
Re: Newbie has more is_null woes

Posted by Big Moxy on 08/04/07 20:32

On Aug 4, 12:06 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
> On Sat, 04 Aug 2007 18:25:41 +0200, Big Moxy <bigm...@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="^^no^^" name="logo" value="296.06" name="part_sell_price"
> > value="" name="phrase" value="script" name="font_type" value="386"
> > name="thread_color" value="^^no^^" name="nomex" value="Next >>"
> > name="Submit"
>
> > <?php
> > session_start();
> > foreach ($_POST as $key => $value) {
> > $_SESSION[$key] = $value;
> > }
>
> > while (list($name, $value) = 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=\"$value\" name=\"$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 string
> 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- Hide quoted text -
>
> - Show quoted text -

Well, I concluded that empty() solved my problem! Thank for the advice
on (foreach($_POST as...)) too! This has been an adventure.

cheers!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация