Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $page_title = "Home";
- include('header.inc');
- $val = "$";
- ?>
- <div id="content_wrap">
- <div id="products-content">
- <h1>Take a look at our cakes. See anything you like?</h1>
- <form action="getCake.php" method="get">
- <select name="type" id="caketypes">
- <option value="all">All</option>
- </select>
- <input type="submit" value="Submit" />
- </form>
- <script src="display.js"></script>
- <table>
- <?php
- //Connect
- $db = mysqli_connect("localhost","root","","cakecreations");
- //query
- $results = mysqli_query($db, "select * from cakes");
- //process
- while($row = mysqli_fetch_array($results))
- {
- echo "<td>";
- print "_____________________________________________";
- echo "</td>";
- echo "<tr>";
- echo "<td>";
- print "<h2><a href='Product.php?cakename={$row['cakename']}'>{$row['cakename']}</a></h2>";
- echo "</td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td>";
- print "<img src='/Assignment/images/{$row['image']}' width='200' height='200' />";
- echo "</td>";
- echo "<td>";
- echo "<table>";
- echo "<tr>";
- print "<h3>{$row['description']}</h3>";
- echo "</tr>";
- echo "<tr>";
- print "<h3>{$row['baker']}";
- echo "</tr>";
- echo "<tr >";
- echo "<td id='testthing'>";
- print "<h3>$val{$row['price']}</h3>";
- echo "</td>";
- echo "<td>";
- if (isset($_SESSION['username']))
- {
- echo "<button type='button'>add to cart</button>";
- }
- else
- {
- echo "<p>Login to add</p>";
- }
- echo "</td>";
- echo "</tr>";
- echo "</table>";
- echo "</td>";
- echo "</tr>";
- }
- ?>
- </table>
- </div>
- </div>
- <?php
- include('footer.inc');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement