Page doesn't load first time

This is a discussion on Page doesn't load first time within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello all. I am having a problem with my PHP page. The first time you start the browser and try ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-22-2004
Bob
 
Posts: n/a
Default Page doesn't load first time

Hello all. I am having a problem with my PHP page. The first time you
start the browser and try to load the page, all that comes back is a
blank page. In Opera when I view the source I get nothing and in IE I
get

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

Then, if you hit the refresh button on the browser the pages with load
and everything will work fine as lonog as you leave the browser up.

Anyone have any idea why this is happening?


Here is the first page.....

<?php
session_start();
global $logged_in;
$logged_in = false;
include("login.php");

include ('meta.html');
include ('header.html');

displayLogin();

include ('footer.html');
flush();
?>
Reply With Quote
  #2 (permalink)  
Old 07-23-2004
Colin McKinnon
 
Posts: n/a
Default Re: Page doesn't load first time

Bob wrote:

> Hello all. I am having a problem with my PHP page. The first time you
> start the browser and try to load the page, all that comes back is a
> blank page.
>

<snip>
> Anyone have any idea why this is happening?
>

Use a command line tool to get the page - that way you'll get a better
picture of any redirections - e.g. curl.

Why not try:
<?php
$log="started\n";
session_start();
print $log."session started\n";
// if you've got more header directives you want to test,
// keep appending to $log instead of printing immediately
global $logged_in;
$logged_in = false;
print $log;
include("login.php");

print "included login.php";
include ('meta.html');
include ('header.html');
print "included meta & header...\n";
....


HTH

C.
Reply With Quote
  #3 (permalink)  
Old 07-23-2004
Bob
 
Posts: n/a
Default Re: Page doesn't load first time


There is nothing in any of the logs pertaining to HTTPD and I forced a
PHP log but it also has nothing. In Opera when I view the soure I get
nothing in IE, the view source is nothing.

The only interesting thing is that the first time I view index.php the
access_log file puts this line in

192.168.0.1 - - [23/Jul/2004:17:47:18 -0400] "GET /index.php
HTTP/1.1" 200 5

which leads me to believe that httpd send 5 bytes back cuase after the
refresh is hit the log shows


192.168.0.1 - - [23/Jul/2004:17:48:06 -0400] "GET / HTTP/1.1" 304 -



On Thu, 22 Jul 2004 13:53:54 -0700, "Michael Vilain
<vilain@spamcop.net>" wrote:
>what does the web server's logs show? any errors in the error_log file?
>What is the server actually sending to your browser? Any strange result
>codes?


Reply With Quote
  #4 (permalink)  
Old 07-23-2004
Bob
 
Posts: n/a
Default Re: Page doesn't load first time


There is nothing in any of the logs pertaining to HTTPD and I forced a
PHP log but it also has nothing. In Opera when I view the soure I get
nothing in IE, the view source is nothing.

The only interesting thing is that the first time I view index.php the
access_log file puts this line in

192.168.0.1 - - [23/Jul/2004:17:47:18 -0400] "GET /index.php
HTTP/1.1" 200 5

which leads me to believe that httpd send 5 bytes back cuase after the
refresh is hit the log shows


192.168.0.1 - - [23/Jul/2004:17:48:06 -0400] "GET / HTTP/1.1" 304 -



On Thu, 22 Jul 2004 13:53:54 -0700, "Michael Vilain
<vilain@spamcop.net>" wrote:
>what does the web server's logs show? any errors in the error_log file?
>What is the server actually sending to your browser? Any strange result
>codes?


Reply With Quote
  #5 (permalink)  
Old 07-23-2004
Bob
 
Posts: n/a
Default Re: Page doesn't load first time

if I use the command line PHP this is what I get back

X-Powered-By: PHP/4.2.2
Set-Cookie: PHPSESSID=6e104abfd7b17920ad14c9965c69bd41; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html

and then the command prompt......


Colin McKinnon <colin.deletethis@andthis.mms3.com> wrote in message news:<cdqrpf$oo9$1$830fa795@news.demon.co.uk>...
> Use a command line tool to get the page - that way you'll get a better
> picture of any redirections - e.g. curl.

Reply With Quote
  #6 (permalink)  
Old 07-23-2004
Bob
 
Posts: n/a
Default Re: Page doesn't load first time

I tried something liek you suggested. I opened a log file and wrote
each debug line into the file and then closed it at the end. EVERY
debug line appeared in the file and I still got the blank screen and
blank command line display. Here is the new page:

<?php
$riffd = fopen("/tmp/RIF.log", "w");
fputs ($riffd, "starting.....\n");
session_start();
fputs ($riffd, "after session_start.....\n");
$_SESSION['logged_in'] = false;
global $logged_in;
$logged_in = false;
include("login.php");

include ('meta.html');
include ('header.html');

displayLogin();

include ('footer.html');
flush();
fputs ($riffd, "done.....\n");
fclose (logfd);
?>


and after the run, here is the log

starting.....
after session_start.....
done.....




Colin McKinnon <colin.deletethis@andthis.mms3.com> wrote in message news:<cdqrpf$oo9$1$830fa795@news.demon.co.uk>...
> Why not try:
> <?php
> $log="started\n";
> session_start();
> print $log."session started\n";
> // if you've got more header directives you want to test,
> // keep appending to $log instead of printing immediately
> global $logged_in;
> $logged_in = false;
> print $log;
> include("login.php");
>
> print "included login.php";
> include ('meta.html');
> include ('header.html');
> print "included meta & header...\n";

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:38 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0