Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.85 KB | None | 0 0
  1. <html>
  2. <head></head>
  3. <body>
  4. <?php
  5. $username="totally_bob";
  6. $password="bob1";
  7. $database="totally_catalogue";
  8.  
  9. mysql_connect(localhost,$username,$password);
  10. @mysql_select_db($database) or die( "Unable to select database");
  11.  
  12.  
  13.  
  14. if ($_GET){
  15. if($_GET['product_id'} {
  16. $result = mysql_query("SELECT * FROM products2 WHERE product_id = '" . $_GET['product_id'] . "'");
  17. }
  18. else if ($_GET['start']) {
  19. $start=$_GET['start'];// To take care global variable if OFF
  20. if(strlen($start) > 0 and !is_numeric($start)){
  21. echo "Data Error";
  22. exit;
  23. }
  24. $eu = ($start - 0);
  25. $limit = 50; // No of records to be shown per page.
  26. $dis = $eu + $limit;
  27. $back = $eu - $limit;
  28. $next = $eu + $limit;
  29. $query2=" SELECT * FROM products2 ";
  30. $result2=mysql_query($query2);
  31. echo mysql_error();
  32. $nume=mysql_num_rows($result2);
  33.  
  34. $result = mysql_query("SELECT * FROM products2 limit $eu, $limit ");
  35. }
  36. while($row = mysql_fetch_array($result)) {
  37. $first=$row["product_artist2"];
  38. $last=$row["product_artist"];
  39. $title=$row["product_title"];
  40. $format=$row["product_format"];
  41. $label=$row["product_label"];
  42. $mono=$row["product_monostereo"];
  43. $condition=$row["product_condition"];
  44. $special=$row["product_special"];
  45. $origin=$row["product_origin"];
  46. $price=$row["product_price"];
  47. $offer=$row["product_offer"];
  48. $comment=$row["product_comment"];
  49. $picture=$row["product_picture"];
  50. $id=$row["product_id"];
  51.  
  52.  
  53. ?>
  54. <center>
  55. <table border="1" cellpadding="3" style="float:left;">
  56. <tr>
  57. <td>Artist:</td>
  58. <td><?=$first . $last;?></td>
  59. </tr>
  60. <tr>
  61. <td>Title:</td>
  62. <td><?=$title;?></td>
  63. </tr>
  64. <tr>
  65. <td>Format:</td>
  66. <td><?=$format;?></td>
  67. </tr>
  68. <tr>
  69. <td>Label:</td>
  70. <td><?=$label;?></td>
  71. </tr>
  72. <tr>
  73. <td>Mode:</td>
  74. <td><?=$mono;?></td>
  75. </tr>
  76. <tr>
  77. <td>Condition:</td>
  78. <td><?=$condition;?></td>
  79. </tr>
  80. <tr>
  81. <td>Origin</td>
  82. <td><?=$origin;?></td>
  83. </tr>
  84. <tr>
  85. <td>Special Info</td>
  86. <td><?=$special;?></td>
  87. </tr>
  88. <tr>
  89. <td>Comments:</td>
  90. <td><?=$comment;?></td>
  91. </tr>
  92. <tr>
  93. <td>Price/Offer:</td>
  94. <td>Fixed price: <?=$price;?><br/>
  95. Current Offer:<?=$offer;?></td>
  96. </tr></table>
  97. <table style="float: left;" border="1" cellpadding="0">
  98. <tr><td><a href="images/<?php echo $picture ; ?>"><img src="images/<?= $picture; ?>" width="650" height="400"></a></td></tr>
  99. </table>
  100. </center>
  101. <?php
  102.  
  103. }
  104.  
  105. }
  106.  
  107. ?>
  108. <b><center>Current List (updated 06/08/10 14.10) - Click for pictures (some aren't uploaded yet - please enquire)</center></b><br><br>
  109. <center>To make an offer for an item or if you have any questions, <a href="mailto:enquiries@totallyvinyl.com">please email us enquiries at totallyvinyl.com</a>
  110. <b><i><center><font color"red">Note - May take a while to load depending on your internet connection.</font></i></b></center>
  111. <table border="1" cellpadding="2">
  112. <tr>
  113. <th><font face="Arial, Helvetica, sans-serif">Info</font></th>
  114. <th><font face="Arial, Helvetica, sans-serif">Artist</font></th>
  115. <th><font face="Arial, Helvetica, sans-serif">Title</font></th>
  116. <th><font face="Arial, Helvetica, sans-serif">Format</font></th>
  117. <th><font face="Arial, Helvetica, sans-serif">Label/CatNo.</font></th>
  118. <th><font face="Arial, Helvetica, sans-serif">Mode</font></th>
  119. <th><font face="Arial, Helvetica, sans-serif">Condition (Cvr/Disc)</font></th>
  120. <th><font face="Arial, Helvetica, sans-serif">Special</font></th>
  121. <th><font face="Arial, Helvetica, sans-serif">Origin</font></th>
  122. <th><font face="Arial, Helvetica, sans-serif">Price</font></th>
  123. <th><font face="Arial, Helvetica, sans-seri\">Current Offer</font></th>
  124. </tr>
  125.  
  126. <?php
  127. while($row = mysql_fetch_array($result)) {
  128. $first=$row["product_artist2"];
  129. $last=$row["product_artist"];
  130. $title=$row["product_title"];
  131. $format=$row["product_format"];
  132. $label=$row["product_label"];
  133. //$catno=$row["product_catno"];
  134. $mono=$row["product_monostereo"];
  135. $condition=$row["product_condition"];
  136. $special=$row["product_special"];
  137. $origin=$row["product_origin"];
  138. $price=$row["product_price"];
  139. $offer=$row["product_offer"];
  140. $comment=$row["product_comment"];
  141. $picture=$row["product_picture"];
  142. $id=$row["product_id"];
  143. ?>
  144.  
  145.  
  146. <tr>
  147. <td><font size=1 face="Arial, Helvetica, sans-serif"><a href="display.php?product_id=<?=$id;?>">More info</a></font></td>
  148. <td><font size=2 face="Arial, Helvetica, sans-serif"><?=$first;?> <?=$last;?></font></td>
  149. <td><font size=1 face="Arial, Helvetica, sans-serif"><?=$title;?></font></td>
  150. <td><font size=1 face="Arial, Helvetica, sans-serif"><?=$format;?></font></td>
  151. <td><font size=1 face="Arial, Helvetica, sans-serif"><?=$label;?></font></td>
  152. <td><font size=1 face="Arial, Helvetica, sans-serif"><?=$mono;?></font></td>
  153. <td><font size=1 face="Arial, Helvetica, sans-serif"><?=$condition;?></font></td>
  154. <td><font size=1 face="Arial, Helvetica, sans-serif"><?=$special;?></font></td>
  155. <td><font size=1 face="Arial, Helvetica, sans-serif"><?=$origin;?></font></td>
  156. <td><font size=1 face="Arial, Helvetica, sans-serif"><?=$price;?></font></td>
  157. <td><font size=1 face="Arial, Helvetica, sans-serif"><?=$offer;?></font></td>
  158. </tr>
  159. <?php
  160. }
  161. echo "<table align = 'center' width='50%'><tr><td align='left' width='30%'>";
  162. if($back >=0) {
  163. print "<a href='$page_name?start=$back'><font face='Verdana' size='2'>PREV</font></a>";
  164. }
  165.  
  166. echo "</td><td align=center width='30%'>";
  167. $n=0;
  168. $n=1;
  169. for($n=0;$n < $nume;$n=$n+$limit){
  170. if($n <> $eu){
  171. echo " <a href='$page_name?start=$n'><font face='Verdana' size='2'>$l</font></a> ";
  172. }
  173. else { echo "<font face='Verdana' size='4' color=red>$l</font>";} /// Current page is not displayed as link and given font color red
  174. $l=$l+1;
  175. }
  176. echo "</td><td align='right' width='30%'>";
  177. if($dis < $nume) {
  178. print "<a href='$page_name?start=$next'><font face='Verdana' size='2'>NEXT</font></a>";}
  179. echo "</td></tr></table>";
  180.  
  181.  
  182. }
  183. ?>
  184.  
  185. </table>
  186. </body>
  187. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement