Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once ("includes/session.php")?>
- <?php confirm_logged_in()?>
- <?php require_once ("includes/connection.php")?>
- <?php include ("includes/header.php")?>
- <?php include ("includes/navigation.php")?>
- <p><h2>Zine DB Archives</h2></p>
- <script type="text/javascript" src="includes/script.js"></script>
- <table width="100%" cellpadding="5">
- <form action="" method="POST">
- <center>
- <select name="issueSelect">
- <?php
- //Generating the drop-down list for the magazine issues.
- try
- {
- $query = $dbh->prepare ("SELECT * FROM `ZineDB`.`Magazine`");
- $query->execute ();
- }catch (PDOException $pdoe) {
- echo $pdoe->getMessage();
- }
- $result = $query->fetchAll();
- //Populate.
- foreach ($result as $index => $row) {
- echo "<option value=\"{$row["Issue"]}\">{$row["Issue"]}</option>";
- }
- ?>
- </select>
- <input type="submit" name="issue" value="Issue"/>
- <select name="authorName">
- <option value="authorOption" selected="selected">Search by author...</option>
- <?php
- //Generating the drop-down list for article authors.
- try
- {
- $query = $dbh->prepare ("SELECT DISTINCT(Author) FROM `ZineDB`.`Article`");
- $query->execute ();
- }catch (PDOException $pdoe) {
- echo $pdoe->getMessage();
- }
- $result = $query->fetchAll();
- //Populate.
- foreach ($result as $index => $row) {
- echo "<option value=\"{$row["Author"]}\">{$row["Author"]}</option>";
- }
- ?>
- </select>
- <input type="submit" name="Author" value="Author"/>
- <select name="topicName">
- <option value="articleTypeOption" selected="selected">Search by article type...</option>
- <?php
- //Generating the drop-down list for article topics.
- try
- {
- $query = $dbh->prepare ("SELECT DISTINCT(Topic) FROM `ZineDB`.`Article`");
- $query->execute ();
- }catch (PDOException $pdoe) {
- echo $pdoe->getMessage();
- }
- $result = $query->fetchAll();
- foreach ($result as $index => $row) {
- echo "<option value=\"{$row["Topic"]}\">{$row["Topic"]}</option>";
- }
- ?>
- </select>
- <input type="submit" name="Topic" value="Topic"/></center>
- <br/><br/>
- <!-- Allowing for search by text.-->
- <center><input type="text" name="byText" class="reqd" value="Search by text"/>
- </br>
- <input type="submit" name="Text" value="Search"/></center>
- </form>
- </table>
- <br/>
- <?php
- if ($_POST["issue"] && !empty($_POST["issueSelect"]))
- {
- header ("Location: magazine_pages.php?issue=" . urlencode($_POST["issueSelect"]));
- exit;
- }
Add Comment
Please, Sign In to add comment