Hey,
I have an issue where the below script doesnt appear to be working. It doesnt actually display anything on the page, it seems as though after the first PHP tag is just ignores the rest of the script. when looking at the page source all it shows is:
<HTML>
<HEAD>
<TITLE>Logs</TITLE>
</HEAD>
<BODY>
The actual code is below:
<HTML>
<HEAD>
<TITLE>Logs</TITLE>
</HEAD>
<BODY>
<?PHP
$mysqlserver="localhost";
$mysqlusername="root";
$mysqlpassword="test";
$dbname = 'test';
$con=mysqli_connect($mysqlserver, $mysqlusername, $mysqlpassword, $dbname);
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con, "SELECT * FROM forwardtable");
echo "<table border='1'>
<tr>
<th>Acc Num</th>
<th>Send Date</th>
<th>Send Time</th>
</tr>";
while($rowContent = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $rowContent['Acc'] . "</td>";
echo "<td>" . $rowContent['Date'] . "</td>";
echo "<td>" . $rowContent['Time'] . "</td>";
echo "</tr>";
}
echo "</table>"
?>
</BODY>
</HTML>
If I remove the PHP from within the code the source code goes as it should and shows the </BODY> and </HTML> tags.
Any ideas anyone?
Thanks,
Matt