Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("template/configure.php");
- include("config.inc.php");
- $db=mysql_connect($dbhost,$dbuser,$dbpass);
- if ($db==FALSE) die ("Errore accesso al database.");
- mysql_select_db($dbname,$db) or die ("Errore accesso al database.");
- ?>
- <h2 style="font-size:32px; text-align:center;"><font color="#000000"><strong>Lavori Realizzati</h2></strong>
- <table width="900">
- <tr>
- <?php
- if(IsSet($_GET['page']) && Is_Int($_GET['page']) {
- $limit = $_GET['page'];
- }else{
- $limit = 0;
- }
- $sql = sprintf("SELECT * FROM png ORDER BY id DESC LIMIT %s,9;", mysql_real_escape_string($limit));;
- $rs = mysql_query($sql) or die(mysql_error());
- $counter = 0; // contatore per il numero dei risultati trovati
- while ($row = mysql_fetch_array($rs)) {
- $body = ""; // conterrĂ la parte risultante della pagina
- if($counter != 0 && $counter % 3 == 0) {
- $body .= "</tr><tr><td><br></td></tr><tr>";
- }
- ++$counter;
- $id = $row['id'];
- $body .= '<td width="200">';
- // INSERIMENTO IMMAGINE
- $dir = 'Immagini/link/'.$id.'.png';
- if (file_exists($dir)) {
- $body .= '<img src="'.$dir.'" webstripperwas="'.$dir.'" width="230" height="190" border="0">';
- } else {
- // IMMAGINE CON SCRITTO ANTEPRIMA NON DISPONIBILE
- }
- $body .= '<div class="scheda"> Sito Web: <a href="'.$row['links'].'" target="_blank">'.$row['links'].'</a>';
- $body .= '<div class="scheda"> Scheda: <a href="schedasitiweb.php?id='.$row['id'].'"> Vai alla scheda</a>';
- $body .= '</td>';
- echo $body;
- }
- ?>
- </tr>
- </table>
- <?php
- $Query = mysql_query("SELECT COUNT(*) as `tot` FROM `png`;");
- if($Result = mysql_fetch_array($Query)) {
- $pagine = $Result['tot'] / 9;
- for($i = 0; $i <= $pagine; $i++) {
- ?><a href="?page=<?php echo $i; ?>"><?php echo $i; ?></a> - <?php
- }
- }
- ?>
Add Comment
Please, Sign In to add comment