Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Set the defaul timezone
- date_default_timezone_set('America/New_York');
- // MySql variables
- $username = "n********";
- $password = "*******";
- $database = "n******";
- // Connect to the db
- mysql_connect(localhost,$username,$password);
- @mysql_select_db($database) or die("Unable to select database");
- // Function variables
- $id = $_POST['id'];
- $day = date("D");
- if ($id==0){
- echo '<table>';
- // Select the stuff from the db
- $query = "SELECT * FROM `rmf` ORDER BY `id` ASC";
- $result=mysql_query($query);
- while ($row=mysql_fetch_array($result)) {
- $name = $row['name'];
- $id = $row['id'];
- // Show the stuff from the db
- echo "<tr><td><a href=\"/rmf.php?id=" . $id . "\" title=\"View " . $name . "&astr;s Face\">" . $name . "</a></td></tr>\n";
- }
- echo '</table>';
- }else{
- // Select the stuff from the db
- $query = "SELECT * FROM `rmf` WHERE id='$id'";
- $result=mysql_query($query);
- while ($row=mysql_fetch_array($result)) {
- $name = $row['name'];
- $vote = $row['vote'];
- $numvotes = $row['numvotes'];
- $pic = $row['pic'];
- // Show the stuff from the db
- echo '<h1>' . $name . '</h1>';
- echo '<img src="' . $pic . '" alt="' . $name . '&astr;s Face" /><br />';
- echo '<p>' . $name . ' has a rating of ' . $vote . '</p>';
- echo '<p>' . $numvotes . ' people have voted.</p>';
- }
- }
- mysql_close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement