PHP refresh

Hi

I'm having trouble with the website i have created.
Basically - i am using php to act as a front end to some text files.

I am parsing these files and displaying the content to the reader.
Within this content, the user can choose to browse the previous file or the next file.
Each of these links have been coded by calling the php script passing a page id parameter in the call ..

eg.

showpage.php?id=100

This seems to work fine for the first view, and then when you click on the links to see , for example, pages 99 or 101, the php scripts seems to not respond (the web page is completely blank). If i hit refresh - then the page that i want, i..e either 99 or 101, is displayed.

How can i save the user from having to click refresh each time? i.e how can i make clicking the link, refresh the page with the returned contents from the server.
[917 byte] By [ambercelery] at [2007-11-19 19:48:13]
# 1 Re: PHP refresh
Do you have an example of this anywhere online?
I've seen this problem before, but I would think it is a server problem, not a code or browser problem.
Dr. Script at 2007-11-10 3:57:36 >
# 2 Re: PHP refresh
Personally, I would like to see the code. Could you please post that using code tags ( http://www.dev-archive.com/forum/misc.php?do=bbcode)
PeejAvery at 2007-11-10 3:58:47 >
# 3 Re: PHP refresh
Hi guys,

I'm afraid I'm not able to send a link to the site as it is still under development and I am trying to help a friend out creating this site for their business so I dont think they would want anyone to see it before it goes live (its not a big business though!)

However the code snippet I am using is within the html for a page called showpage.php
Here is the link I am trying to use from the logid page 101

<a href="showpage.php?log=user1&page=entry&logid=101">Next Entry</a>
ambercelery at 2007-11-10 3:59:46 >
# 4 Re: PHP refresh
I think you misunderstand. Can you please show the PHP code that gets the address bar variables?
PeejAvery at 2007-11-10 4:00:48 >
# 5 Re: PHP refresh
Sorry...

Right here is the part of the Php script

it references to an inc file which uses CSS to display the page, and prints out the variable $message in a certain part of the page.

So my problem comes from when i am on a page which is already displaying the contents of the reply from the server, and i want to link through to a new page to get a different contents in $message

if (@$log)
{
if (!ereg("^[A-Za-z' -]{1,30}$",$log))
{
unset($do);
$message = "$value is not a valid log. Please try again.";
include("showpage.inc");
}
else
{
$logtitle="Log Title";

switch (@$page)
{
case "entry":
{
if (@$logid)
{
$file = fopen("$log/logs/$logid.txt","r");

while (!feof($file)) {
$fileline = fgets($file);

$message=trim($fileline);

}
fclose($file);

$message = $message . "<hr />";

include("showpage.inc");
break;
}
ambercelery at 2007-11-10 4:01:47 >
# 6 Re: PHP refresh
You stated in your first post that the webpage shows completely blank. This means that it is server-side but also that there is probably an error in the PHP. Now why that goes away at refresh is interesting.
PeejAvery at 2007-11-10 4:02:47 >