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.
# 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>
# 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;
}