Code: Select all
<html>
<link rel = "stylesheet" type = "text/css" href = "main.css">
<title>
Buy All The Stuff!
</title>
</html>
<?php
echo '<div class = "header">';
echo 'This is a header example';
echo '</div>';
$hostname = "localhost";
$username = "root";
$password = "";
$conn = mysql_connect($hostname,$username,$password) or die("MYSQL could not connect");
$productDB = mysql_select_db('affiliatemarketing',$conn) or die ("Could not select database");
$result = mysql_query("SELECT * FROM products ORDER BY price");
echo '<div class = "bars">';
echo '<div class = "leftNavBar">';
echo 'This is the left nav bar';
echo '</div>';
echo '<div class = "content">';
while($row = mysql_fetch_assoc($result)){
echo '<div class = "products">';
echo '<div class = "productText">';
echo "<strong><font color='black'>Name:</strong></font> " . $row['name'] . "</br>";
echo "<strong><font color='black'>Description:</strong></font>" . $row['description'] . "</br>";
echo "<strong><font color='black'>Price: </strong></font>$" . $row['price'] . "</br>";
echo '<div class = "productButton">';
echo '<form action = "purchasePage.php">';
echo '<input type = "button" name="purchase" value="Purchase Now!" id="purchase">';
echo '</div>';
echo '</div>';
echo '<div class = "productImage">';
echo "<img src='./" . $row['photo'] . "' height='350px' width='350px'/></br></br></br>";
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '<div class = "rightNavBar">';
echo 'This is the right nav bar';
echo '</div>';
echo '</div>';
?>