You are here: Re: What is wrong with this if test? « PHP Programming Language « IT news, forums, messages
Re: What is wrong with this if test?

Posted by Pedro Graca on 12/29/05 11:40

Shelly wrote:
> OK, I am at a toral loss after having programmed for forty years.

Turn on error_reporting for all errors, warnings and notices.
.... maybe you'll notice some uninitialized variable.

Insert these two lines at the top of your script

error_reporting(E_ALL);
ini_set('display_errors', '1');

<snip>
> for ($i=0; $i<$numHint_2; $i++) {
> $index = $hint_2_Lookup[$i];
> if ($index == $selHint_2) {

possible use of unassigned variable?

> $sel = " selected ";
> } else {
> $sel = "";
> }
> $tmpHint2[] = '<option value="' . $index . '"' . $sel . '>' .
> $hint_2[$i] . '</option>';
> // next line put in for debugging only
> $foo .= 'index=' . $index . ' option value="' . $index . '"' .
> $sel . $hint_2[$i]. "<br>";
> }
> $tmpHint2[] = '</select></td>';
>
> $selHint_2 = $_SESSION['vmHint_2']; // put in for
> debugging only

You're assigning to $selHint_2 after you've used the variable in the
test above.

> echo "selHint_2=" . $selHint_2 . "<br>"; // put in for
> debugging only
> echo implode("\n",$tmpHint2)."\n";
> echo $foo; // put in for debugging only

Happy debugging :)

--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!

 

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

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