gdebojyoti.mail96
Member
- Messages
- 89
- Reaction score
- 0
- Points
- 6
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 -
My site's folder structure is -
At the top of my every page (index.php, profile.php, etc), I am "including" the above using <code>include('../include/loggedStatus.php');</code>
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
with the full script!
Am I missing something, or is it a bug in the webkit engine?
Code:
<?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 -
Code:
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 <code>include('../include/loggedStatus.php');</code>
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
Code:
include('../include/loggedStatus.php');
Am I missing something, or is it a bug in the webkit engine?
Last edited: