Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require("variables.php");
- mysql_connect($host, $user, $pass);
- mysql_select_db($db);
- if (!empty($_GET['id'])) {
- $id = $_GET['id'];
- $query = "SELECT * FROM approved WHERE id=".$_GET['id'];
- }
- elseif (!empty($_GET['option'])) {
- $op = $_GET['option'];
- if ($op == "random") {
- $query = "SELECT * FROM approved ORDER BY rand() LIMIT ".$perpage;
- }
- elseif ($op == "top") {
- $query = "SELECT * FROM approved ORDER BY total DESC LIMIT 100";
- }
- }
- elseif ($op == "latest") {
- }
- else {
- $query = "SELECT * FROM approved LIMIT ".$perpage;
- }
- $result = mysql_query($query);
- ?>
- <html>
- <head>
- <title>Quote Database</title>
- <link rel="stylesheet" type="text/css" href="default.css" />
- </head>
- <body>
- <div id="main">
- <div id="header">
- <div id="logo">
- <img src="logo.png" width="100px" height="70px" />
- <div style="float:right;">
- <h1>Quote Databse</h1>
- <h2>Owned by Lkill</h2>
- </div>
- </div>
- <div id="menu">
- <ul>
- <li><a href="index.php">Home</a></li>
- <li><a href="index.php?option=latest">Latest</a></li>
- <li><a href="index.php?option=random">Random</a></li>
- <li><a href="index.php?option=top">Top</a></li>
- <li><a href="#">Home</a></li>
- </ul>
- </div>
- </div>
- <div id="content">
- <?php
- while ($row = mysql_fetch_array($result)) {
- $text = "<div id=\"wrap\"><ul><li><a href=\"index.php?id=".$row['id']."\">".$row['id']."</a></li><li><a href=\"vote.php?id=".$row['id']."&op=u\">".$row['up']." + </a></li><li>(".$row['total'].")</li><li><a href=\"vote.php?id=".$row['id']."&op=d\">". $row['down'] ."- </a></li></ul>\n";
- $text = $text."<div id=\"quote\">".$row['quote']."</div>";
- echo $text;
- }
- ?>
- </div>
- <div id="footer">
- <p>Testing</p>
- </div>
- </body>
- </html>
- <?php mysql_close(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement