I've been beating myself over the head with this code for 3 days now. I think I've been looking at it too long, so I need some friendly eyes to tell me what I am missing. The code doesn't run, gives me the error below. Any help is appreciated.
Parse error: parse error, unexpected $end in D:\Program Files\Apache Group\Apache2\htdocs\test.php on line 58
<?php
function OrderLog () {}
function SaveIt ($mfg)
{
$vendors = array (
array ("putco", "putco"),
array ("macneil|weathertech", "macneil"),
array ("agri\-cover|agricover", "agricover"),
array ("(allen racks)|allen", "allen"),
array ("(dac technologies)", "dac"),
array ("(lange originals)", "lange"),
array ("sportsrack|thule|yakima", "sportsrack"),
array ("tsi", "tsi"),
array ("taxor", "taxor"),
array ("(downey tonneaus)", "downey"),
array ("autotechnica", "apa"),
array ("wheelskins", "wheelskins"),
array ("^[a-g]", "wd-ag"),
array ("^[h-r]", "wd-hr"),
array ("^[h-r]", "wd-sz")
);
for ($i=0; $i < count ($vendors); $i++)
{
$condition = $vendors[$i][0];
$file = $vendors[$i][1];
if (eregi ($condition, $mfg))
{
if (eregi ("^wd", $file))
if (($GLOBALS['found_vendor']['wd-ag'] == '') || ($GLOBALS['found_vendor']['wd-hr'] == '') || ($GLOBALS['found_vendor']['wd-sz'] == ''))
{
OrderLog ($GLOBALS["OrderNo"] ."\n", "/home/php/parse/$file");
$GLOBALS ["found_vendor"]["$file"] = true;
return strtoupper ("$file");
}
elseif (! ($GLOBALS["found_vendor"]["$file"] == ''))
{
OrderLog ($GLOBALS["OrderNo"]."\n", "/home/php/orders/$file");
$GLOBALS['found_vendor]["$file"] = true;
return strtoupper("$file");
}
}
}
return "FAILED";
}
$OrderNo = "truckstuffusa-12456";
$init_vendors = array ("putco","macneil", "agricover", "allen", "dac", "lange", "sportsrack", "tsi", "taxor", "downey", "apa", "wheelskins", "wd-ag", "wd-hr", "wd-sz");
foreach ($init_vendors as $ven)
{ $found_vendor["$ven"] = false; }
$Items[0] = "Whatever by Putco";
$Items[1] = "running boards by Westin";
if ($OrderNo)
{
foreach ($Items as $item => $desc)
{ echo "$item. $desc<br>"; }
}
?>