Page 1 of 1

invalid args?

Posted: Tue Aug 08, 2006 3:59 pm
by Obadiah
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


im getting the error

[b]Warning: Invalid argument supplied for foreach() on line 36[/b]

for this block of code

Code: Select all

foreach($fields_1 as $field => $value)
{
	if(ereg("pass",$field))
		$type = "password";
	else
		$type = "text";
	echo "	<tr><td style=\"text-align:right;
			font-weight:bold\">$value</td>
		<td><input type='$type' name='$field'
				value='".@$$field."'
				size='{$length_1[$field]}'>
		</td></tr>\n";
}
is it because the file its not picking up the database? any suggestions as to how i would go about correcting the problem?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue Aug 08, 2006 4:10 pm
by feyd
$fields_1 isn't an array.

Posted: Tue Aug 08, 2006 4:22 pm
by Obadiah
i made it an array inside another class file

Code: Select all

$fields_1 = 	array(  "fusername" => "User Name",
			"fpassword" => "Password"
			);
but this particular file isnt being referenced to in this file instead the last file i create will reference both of there files. I was trying to check for errors before continuing the project....are these errors that i should worry about before continuing, or just continue onto the last file to run it and see what happens then?