I have been debugging a small clip of code for hours - actually all day. Either I am missing the error, it is a PHP configuration issue, or a PHP bug. I hate to ask for help for a possibe syntax error, but I am pulling my hair out.
PNSLib.php is an include file imported into Master.php - In the interest of brevity, I am including only the section of the code containing the error - If I delete this section, the browser error is gone. I'm convinced the problem lies in the last 16 lines of PNSLib.php.
The following is (1) the output in a browser which you can view at http://mammothmicro.dyndns-web.com/PNS/Master.php, (2) Master.php which calls PNSLib.php (3) the PNSLib.php code (the include file).
Browser output: - This is the error.
Loading PNSLib.php
; "; } // end if $select = mysql_select_db($dbName,$dbConn); if (!$select) { print "problem selecting table" . mysql_error() . "
"; } // end if return $dbConn; // end connectToPNS_DB } ?>
The PNSMaster.php code:
<html>
<head>
<title>PNS Master Main Page</title>
</head>
<body>
<p>Loading PNSLib.php</p>;
<?php
include 'PNSLib.php';
?>
The PNSLib.php code:
<style type = "text/css">
body{
background-color: black;
color: white;
text-align:center
}
</style>
<?
//PNSLib.php
//holds utilities for PNS_DB database
//variables
$userName = "root";
$serverName = "localhost";
$password = "********";
$dbName = "PNS_DB";
$dbConn = "";
$mainProgram = "Master.php";
function connectToPNS_DB() {
//connects to the PNS_DB
global $serverName, $userName, $password;
$dbConn = mysql_connect($serverName, $userName, $password);
if (!$dbConn)
{
print "problem connecting to database..." . mysql_error() . "<br>";
} // end if
$select = mysql_select_db($dbName,$dbConn);
if (!$select)
{
print "problem selecting table" . mysql_error() . "<br>";
} // end if
return $dbConn;
// end connectToPNS_DB
}
?>


I had a hunch and copied my script from this forum page and pasted it to my editor, replaced the old files, and it worked -- I'm thinking now that hidden characters from my editor are to blame.