I just came across a problem which seems pretty unusual to me.
I want to "include" a particular PHP script (loggedStatus.php) in my various pages.
Its contents are -
<?php
@session_start();
//$username,$password,$databaseName declared
if(isSet($_COOKIE['myCookie']))
{
$dbConnection = mysql_connect("localhost",$username,$password);
mysql_select_db($databaseName);
$userLoggedIn = mysql_fetch_array(mysql_query("SELECT * FROM usersList WHERE sessionVal='".$_COOKIE['myCookie']."'"));
mysql_close($dbConnection);
if(!$userLoggedIn['userID']) { echo header("location:../"); exit(); }
}
else { header("location:../"); exit(); }
$relLink = "../";
?>
My site's folder structure is -
mainFolder - social - - index.php - - profile.php - - messages.php - - album.php - - more files... - include - - loggedStatus.php - - more files...
At the top of my every page (index.php, profile.php, etc), I am "including" the above using include('../include/loggedStatus.php');
But whenever I do that, I find a space at the top before my menu bar appears. This occurs only in the webkit browsers (Chrome, Safari, Opera), and not in Firefox.
Everything else appears to be fine.
But the space disappears when I replace the include('../include/loggedStatus.php'); with the full script!
Am I missing something, or is it a bug in the webkit engine?