InsaneTrain Forums
PHP..... - Printable Version

+- InsaneTrain Forums (https://insanetrain.com)
+-- Forum: General (https://insanetrain.com/forumdisplay.php?fid=4)
+--- Forum: General Forum (https://insanetrain.com/forumdisplay.php?fid=8)
+--- Thread: PHP..... (/showthread.php?tid=3919)



PHP..... - leeman - 04-21-2004

Anyone good with PHP here????

I have a prob. I'd like to air....

Code:
Invalid argument supplied for foreach() public_html/sources/Admin/admin_functions.php on line 742

Code:
$html .= "<form name='jumpmenu'>\n<select class='jmenu' name='val'>"; &nbsp; &nbsp;foreach($CATS as $cid => $name) &nbsp;{ &nbsp; $html .= "<optgroup label='$name'>\n"; &nbsp; &nbsp; foreach($PAGES[ $cid ] as $pid => $pdata) &nbsp; { &nbsp; &nbsp;$html .= "<option value='$pdata[1]'>$pdata[0]</option>\n"; &nbsp; } &nbsp; &nbsp; $html .= "</optgroup>\n";



PHP..... - leucetios - 05-04-2004

There are two foreach loops in that snippet. Which one is on line 742? And what are the variables used in the foreach (e.g. what exactly is $CATS and $name if that's the bad foreach)?

Normally you get the invalid argument error when you're passing a non-array variable to foreach


PHP..... - skulbite - 08-03-2004

Yeah, leu, kick some programming ass!!

Just tryng to get my 10 posts.. damn name's pink!! Sucks!!

BTW, leu.. you play too many damn games!! Just saw your Champions just scrolling by!

SmileSmileSmileSmileSmileSmile