Click to See Complete Forum and Search --> : Win2k + phptriad - get php.exe errors


Anon
05-02-2001, 01:35 PM
I had this working ok. It still works on a Win95 system but on win2k it is getting program errors every time this script runs - stays up but takes a dump every time with a Program Error box saying error log being created.

The script is used to log the page and document.referrer (from javascript - I don't see this in php docs so did what I knew) then xfer from the portal page to the real site entry page.

I've left out the db functions. The script is also used as a dummy image for page counting but fails in either role. Strangely the data is all logged ok.

Script extract ==>

// Get any parameters passed
$mgsub = trim($mgsub);
if ($mgsub == "advertise") $mgsub = "?content=advertise";
if ($mgsub == "freeads") $mgsub = "?content=freeads";
if ($mgsub == "sites") $mgsub = "?content=sites";
if ($mgsub == "vans") $mgsub = "?content=vans";
if ($mgsub == "gps") $mgsub = "?content=gps";

$mgloc = trim($mgloc).$mgsub;
$ref = trim($ref);
$page = trim($page);


// Do any updates

if (($page) or ($ref)) $link = do_connect();

if ($page)
{
$doit = upd_page($page);
$doit = upd_tots('page');
$doit = log_page($page);
}

if ($ref)
{
$doit = upd_referrer($ref);
$doit = upd_tots('ref');
}

mysql_close($link);

if ($mgloc) header ("Location: $mgloc");
else header ("Location: ../images/spacer.gif");

exit;

Anon
02-25-2002, 01:44 AM
I get this error too. I use PHPTriad, and WinXP. I figured out what part of the code was making the dump happen:

while( count($arry) > $inc)
{
$arry[$inc] = trim($arry[$inc]);
$inc++;
}


Thats it. Without this code, my script doesn't crash. The trimming works on one element if it isn't in a loop of any kind, just:

$arry[0] = trim($arry[0]);

Also, like mark, the code works, and php stays up, but I still get the error dialog box. I don't get it.