Gidday All,
I have just created a PHP file that looks like this
/forums/forums.php
<?php
include "../include/print.php";
PrintHeader();
PrintSidebar(True); // Without forum top 10
?>
<?php
// Query the MySQL database
$link = mysql_connect("localhost", "root") or die("oh ohhh...");
mysql_select_db("forums") or die("Database error");
// Which Page are we printing
if ($_REQUEST["start"] == "") $start=0;
else $start = $_REQUEST["start"];
$query = "SELECT * FROM topics WHERE IsReply='false' ORDER BY Date DESC LIMIT ".$start.", ".$start+20;
$result = mysql_query($query);
?>
<table border="0" width="100%" cellspacing="0" cellpadding="5">
<tr>
<td width="100%">
<!-----Forum table ----->
<table border="1" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="40%" bgcolor="#ffcc00">
<font face="Verdana" color="#ffffff"><small>Thread</small></font>
</td>
<td width="20%" bgcolor="#ffcc00">
<font face="Verdana" color="#ffffff"><small>Author</small></font>
</td>
<td width="10%" bgcolor="#ffcc00">
<font face="Verdana" color="#ffffff"><small>Date</small></font>
</td>
<td width="10%" bgcolor="#ffcc00">
<font face="Verdana" color="#ffffff"><small>Replies</small></font>
</td>
<td width="20%" bgcolor="#ffcc00">
<font face="Verdana" color="#ffffff"><small>Last Post</small></font>
</td>
</tr>
<?php
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)
{
print " <tr>";
print " <td width=\"40%\">";
print " <a href=\"/forums/showtopic?id=".$line['ID']."\">".$line['Subject']."</a>";
print " </td>";
print " <td width=\"20%\">";
print " ".$line['Author'];
print " </td>";
print " <td width=\"10%\">";
print " ".$line['Date'];
print " </td>";
print " <td width=\"10%\">";
print " ".$line['Replies'];
print " </td>";
print " <td width=\"20%\">";
print " ".$line['ReplyBy'];
print " </td>";
print " </tr>";
}
?>
</table>
</td>
</tr>
</table>
<?php
mysql_free_result($result);
mysql_close($link);
PrintFooter();
?>
But when I try to run this file, the source of the page displayed is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"></HEAD>
<BODY></BODY></HTML>
I know there is nothing wrong with the functions the page uses as they are used in every page on the site. I can copy other files that I have created into this folder and they run just fine. But if I rename that file to anything else it does not run. I have also tried changing the name of the folder and other things like that, all to no avail.
The php code I wrote is an exact copy of the code from another page I did which has never had any problems before, so I'm sure its working fine.
I am running windows 2000 with PHP 4.3.1 and Apache 2.0.45 web server. I have never had this problem before.
Any help would be most appreciated,
~ Paul
Edit: Can you even see any problems with the code?