Automatic Refresh

A

Anonymous

Guest
when i type my php page in the addressbar of my explorer it loads the page in the history and it doesn't run the code .
Then i should refresh the page to run it again .
how can i change my script to run each request ?
 
hoomanik said:
when i type my php page in the addressbar of my explorer it loads the page in the history and it doesn't run the code .
Then i should refresh the page to run it again .
how can i change my script to run each request ?

Do you mean that you have a php script that is supposed to be printing HTML code; when you go to access it, a blank page appears until you refresh? If so, I may be having a similar problem with a site I'm in the process of programming:

http://www.christophermckinney.com/
(Load it in Explorer, and then try going to each link repeatedly; eventually you should see only a blank page; refresh it to see the content)

First, try using Firefox and see if it works with that. If so, then the problem could be the exact same one that I am having.

Some things that I have tried so far are adding a Content-type header at the top of the script:

Code:
header('Content-type: text/html');

The site uses sessions, and another thing that I tried is ensuring that the <a> (anchor) tags are not rewritten to include the session ID. This is the code that I used to accomplish that (thank you user-contributed notes in the PHP manual):

Code:
ini_set('url_rewriter.tags', '');

Neither of those ideas worked, so I am still wondering why it is happening.

Basically this reply is to see if our problems are the same, and also it is another cry for help :help:
 
this seems to be a cache problem

try this
first clear your cache from the browser
and then insert the following code in the start of php page.
Code:
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
 
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");
 
The site I'm doing is still having the problems :eek:

Clicking on the navigation links in IE often loads a completely blank screen until the page is refreshed. What should I do?? I can't seem to fix it!
 
still wondering why people write some messy codes as every code ive looked at that is working weird seams so unlogical...
just test going throught the same code and look if there is any problem... maybe it was your meta tags or php headers that are the problem?
 
Ok, I was able to fix it... Here is how i came about the solution....

I have a meta tag in the HTML that specifies the content-type:
Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

I was also sending an http header at the top of the document with PHP:
Code:
header('Content-type: text/html');

The problem was the charset=utf-8 part in the HTML tag. It didn't match up with the PHP header. So I tried this:
Code:
header('Content-type: text/html; charset=utf-8');

It worked... Yay! But now I have to experiment, because that is silly for it to break in IE because of that. If I took out the HTML tag AND the PHP header function, it worked. If I added the charset to the PHP function and NOT in the HTML tag, it worked. If I took out the html tag completely it worked. If I took out the charset=utf-8 from both, it worked. If I took out the PHP function only, it did NOT work.

So the conclusion, as it turned out for me is: If there is a META tag that specifies the character set and content type in the HTML, it may be a good idea to send an HTTP header that matches what is in the META tag. That should make Internet Explorer happy.

Hopefully this helps someone else as well.

:-D
 
Alexei Kubarev said:
still wondering why people write some messy codes as every code ive looked at that is working weird seams so unlogical...
just test going throught the same code and look if there is any problem... maybe it was your meta tags or php headers that are the problem?

I just noticed your reply... Yes, the meta tags and PHP headers turned out to be the problem... I feel like my coding, PHP as well as HTML, is rather nicely laid-out. Were you talking about the coding of christophermckinney.com? It is XTML Strict and CSS-based, and uses rather streamline PHP coding... I'm not offended if you say it is messy, but how could I make it better?
 
i never ment any coding in particular but ment what other people who post their codes write... and those codes just give me nightmares... im going to take a look at that site that youäve been talking about and tell you if i see anything... however php coding is impossible to see..
 
Back
Top