So would something like this work
PHP Code:
<?php
require 'config.php';
require 'functions.php';
require 'database.php';
if(isset($_POST['category'])) {
$category = $_POST['category'];
$q = "SELECT id, title, description, tn_src FROM wrappers WHERE category='" . mysql_real_escape_string($_GET['category'] . "' ORDER BY id desc";
$result = $mysqli->query($q) or die($mysqli_error($mysqli));
if($result) {
while($row = $result->fetch_object()) {
$title = $row->title;
$d = $row->description;
$category = $row->category;
$tn_src = $row->tn_src;
$src = $row->src;
$id = $row->id;
print '<li>
<a href="wrapper_review.php?id=' . $id . '">
<h1 class="smallh1">' . $title . '</h1>
<img src="' . $tn_src . '" alt="' . $title . '" id="' . $id . '" />
</a>
<p class="smalldesc">' . $d . '</p>
</li>';
print "\n";
}
}
}
I quickly tried running it but got an error which said unexpected ; on the line
PHP Code:
$category = $_POST['category'];
my drop down menu looks like the following:
HTML Code:
<form method="post" action="occasions.php">
<select name="category">
<option value="valentines" onchange="this.form.submit();">Valentines</option>
<option Value="birthday" onchange="this.form.submit();">Birthdays</option>
<option value="weddings" onchange="this.form.submit();">Weddings</option>
<option value="christmas" onchange="this.form.submit();">Christmas</option>
<option value="prom" onchange="this.form.submit();">Prom</option>
<option value="haloween" onchange="this.form.submit();">Haloween</option>
</select>
</form>
Bookmarks