I have narrowed my problem down to this bit:
Code: Select all
<?php
$productgroupfile = file_get_contents("./product-groups.txt");
$productgroups = explode("\n",$productgroupfile);
foreach ($productgroups as $productgroup) {
echo "<a href=\"link.html\">".$productgroup."</a> <br />";
}
?>
The txt file contains:Notice: Undefined variable: productgroups in /Applications/MAMP/htdocs/bau/product-groups.php on line 13
Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/bau/product-groups.php on line 13
I have been staring at those five lines for at few hours, and i seriously can't figure out the problem... Maybe i have just missed a semi-colon or something, maybe im just blind!product1
product2
product3
Thanks in advance,
Mads