HTML not showing up in view page source
Summary: designing a file management system for school, currently working on the page that will display a list of downloads in an HTML table
Problem: Nothing is showing up on the browser when pull up the page that I put onto my website. When I check view page source nothing is listed. Somehow none of my HTML is getting recognized and I’m not sure why.
When I moved my HTML opening tag above the php statement it was the only thing that showed up on the view page source..what am I doing wrong here?
**Update: I commented out the php at the top of my download_list.php file and my HTML displayed. So something is clearly wrong with my php.
The code:
download_list.php :
ini_set( 'display_errors', TRUE );
error_reporting( E_ALL);
require_once('database.php');
// Get all categories
$query = 'SELECT * FROM file
ORDER BY fileID';
$files = $db->query($query);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- the head section -->
<head>
<title>My Downloads</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<div id="container">
<h1>Category List</h1>
<table>
<tr>
<th>Name</th>
<th> </th>
</tr>
<?php foreach ($files as $file) : ?>
<tr>
<td><?php echo $file['filename']; ?></td>
<td>
<form action="download_file.php" method="post"
id="download_file_form">
<input type="hidden" name="category_id"
value="<?php echo $file['filename']; ?>"/>
<input type="submit" value="Download"/>
</form>
</td>
</tr>
<?php endforeach; ?>
</table>
<br />
<h2>Add Category</h2>
<form action="add_category.php" method="post"
id="add_category_form">
<label>Name:</label>
<input type="input" name="name" />
<input id="add_category_button" type="submit" value="Add"/>
</form>
<br />
<p><a href="index.php">List Products</a></p>
</div>
</body>
</html>
database.php :
<?php
mysql_connect("filler.hostica.com", "filler", "filler") or die(mysql_error());
mysql_select_db("filler") or die(mysql_error());
exit();
?>















