Warning: Invalid argument supplied for foreach()

Hi Guys,

I have a script that keeps giving me an error:

Warning: Invalid argument supplied for foreach() in /home/loud/public_html/coreg/worldvision.php on line 62

On that line it is the following:

foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');

Can anyone help me here please as my variables are not being replaced with the data within the variables while this error is happening.

Any help would be great please.

Thanks

foreach expects an array to loop through, and apparently $fields is not an array.
Do a print_r($fields); before the loop to check its content.

When you sort out why your array is not turning up, and you want to turn it into a query string, then take a look at the examples shown for http_build_query :wink: