Forum Moderators: coopster
if (!session_is_registered("member_name")) {
echo ("<img src=\"" . SITE_ROOT . "images_insidemenu/inmember_stat_out.jpg\" width=\"115\" height=\"15\">");
} else {
echo ("<img src=\"" . SITE_ROOT . "images_insidemenu/inmember_stat_in.jpg\" width=\"115\" height=\"15\">");
}
which validates which graphic image to display- if the member has registered, a logged-in image will appear.
This file is in the root folder, while some of the called files, for example, x.php is two levels deep (/library/book1/x.php).
The problem is, although the text appears eventually, it takes forever, as in, around 2 minutes (local workstation setup).
I think the problem is on the do_header.php.
I don't really know if this makes sense, but that's the way it goes. Please help and ask questions if this is not clear.
Or better yet, how can I validate the member_name from the include()d header file or any other alternatives?
I am now thinking of an alternative to this predicament because I am at the point of banging my head on the wall.
Some questions though:
1. If I would use include() to include the header file- which contains a table in HTML, will it be able to validate the member_name using $_session?
2. If it won't be able to validate, what aleternative do I have to display a Logged-in or Logged-out user using an image considering that the header is called even by pages two level deep from the root?
3. How can PHP call a settings.php even from a page two levels deep from the root? Because what I do now is place a copy of settings.php on the different folders that needs it.
Thanks
1. If I would use include() to include the header file- which contains a table in HTML, will it be able to validate the member_name using $_session?
2. If it won't be able to validate, what aleternative do I have to display a Logged-in or Logged-out user using an image considering that the header is called even by pages two level deep from the root?
3. How can PHP call a settings.php even from a page two levels deep from the root? Because what I do now is place a copy of settings.php on the different folders that needs it.
include ($_SERVER['DOCUMENT_ROOT'].'/do_header.php');
I also think that the problem lies with the file size of the php page. If the file is more than 40 kb, the problem occurs.
However, for lower sized files, everything is ok. Does this have something to do with my configuration or something? Sorry but I am a newbie at this and I'm still groping my way around.
Lastly, I shifted back to the original file that I have for the header, which is HTML coding and embedded the PHP script for validation of the member_name, and called the do_header.php via include command. However, this doesn't seem to validate the registered member_name and still displays the logged out image. Any suggestions?
By the way, my structure goes this way:
index.php has a link to article.php
article.php has the include()d do_header.php and an include()d left_menu.php, plus the content of the page the do_header.php contains the validation as to whether the member has logged in (and the session variables has been registered) and displays a graphic image of Logged In, otherwise, it's Logged Out.