Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. <html><head><title>Viewing All Games</title><link href="style.css" rel="stylesheet" type="text/css" /></head><body>
  2. <?php
  3.  
  4. print "<center><a href='Reading01.php'><View All Games></a> // <a href='Adding01.php'><Add Games></a> // <a href='Deleting01.php'><Remove Games></a></center><br>";
  5.  
  6. if (!$_POST[record]) {
  7.   showform();
  8. }
  9.  
  10. function showform() {
  11.   $host="grapir.exaltedlegion.com";
  12.   $user="bloodstar";
  13.   $password="<pass>";
  14.   $db=mysql_connect($host, $user, $password) or die(mysql_error());
  15.  
  16.   mysql_select_db("ahhhhhhhgames",$db);
  17.  
  18. $sql="SELECT id, title, console FROM games ORDER BY title, console ASC";
  19.  
  20. $result=mysql_query($sql, $db) or die(mysql_error());
  21.   print <<<HERE
  22.   <h2>Select a game to modify:</h2>
  23.   <form method='post' action='modify02.php'>
  24.   <select name='record'>
  25.   <option value=''>Please select a game.</option>
  26. HERE;
  27. while ($row=mysql_fetch_array($result)){
  28. $title=$row["title"];
  29. $console=$row["console"];
  30. $id=$row["id"];
  31. print "<option value='$id'>$id - $console - $title</option>";
  32. }
  33. print "<p><br><input type='submit' name='modify' value='modify'></p><input type='hidden' name='id' value='$id'></form>";
  34. }
  35. ?>
  36. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement