[ scepanmali @ 29.03.2008. 03:06 ] @
Imam ove dve stranice i nikako ne mogu da prosledim ove podatke u novu stranicu. Ne znam zasto. Pogledajte kod, pa ako vidite razlog, javite mi, molim vas! PRVA STRANICA: Code: <?php $username = "root"; $password = "root"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "<br>"; $selected = mysql_select_db("spotovi1", $dbhandle) or die("Could not select DB"); // If current page number, use it // if not, set one! if (!isset($_GET['page'])) { $page = 1; } else { $page = $_GET['page']; } $max_results = 20; $from = (($page * $max_results) - $max_results); $table = "oblast_metal"; $id= $row['id']; $row['id']=$id; $row['id']=$id; $row['Artist']=$Artist; $row['Song']=$Song; $sql = mysql_query("SELECT * FROM ".$table." ORDER BY id DESC LIMIT $from, $max_results"); while ($row = mysql_fetch_array($sql)) { ?> <table border="0" bordercolor=#A49F8B align = "center" cellspacing="0" cellpadding= 3 width= 500 > <tr onMouseOver="this.bgColor='#355466';" onMouseOut="this.bgColor='#2c4453';"> <td width= "170" ><font color="white" font size=3><font face="Arial, Helvetica, sans-serif"><? echo $row['Artist']; ?></font></td> <td width= "200"><font color="white"><font face="Arial, Helvetica, sans-serif"><? echo $row['Song']; ?></font></td> <td width= "50"><font face="Arial, Helvetica, sans-serif"><a href="<?php echo "download.php?id=".$row['id'].">".$row['Artist']."- ". $row['Song'] . "";?>" target="_blank" style="text-decoration:none"><b><font color=#A49F8B>Download</b></a></a></font></td> </tr> <?php echo "</table>"; } echo "</br></br></br></br>"; echo "</center>"; echo "<center><font color=#C8C9CA><font size = 4>Select a Page<br />"; // Figure out the total number of results in DB: $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM '".$table."'"),0); //za konacan broj strana $total_pages = ceil($total_results / $max_results); // za PREVIOUS Link if ($page > 1) { $prev = ($page - 1); echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=$prev\"><font color=#C8C9CA> <b><font size = 3><< Previous</a> "; } for ($i = 1; $i <= $total_pages; $i++) { if (($page) == $i) { echo "<b><font size = 3><font color = #C8C9CA>$i "; } else { echo "<b><font color=#C8C9CA><a href=\"" . $_SERVER['PHP_SELF'] . "?page=$i\"><style=text-decoration:none><b><font color=#C8C9CA><font size = 3>[ $i ]</a> "; } } // za NEXT link if ($page < $total_pages) { $next = ($page + 1); echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=$next\"><font color=#C8C9CA><font size = 3> Next >></a>"; } ?> DRUGA STRANICA: Code: <?php $username = "root"; $password = "root"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "<br>"; $table = "oblast_metal"; $table = $_GET["table"]; $row['Artist']=$Artist; $row['Song']=$Song; $id= $row['id']; $id = $_GET['id']; $Artist = $_GET['Artist']; $Song = $_GET['Song']; $selected = mysql_select_db("spotovi1", $dbhandle) or die("Could not select DB"); $sql = mysql_query("SELECT * FROM '".$table."' WHERE ID = '$id'"); while ($row = mysql_fetch_array($sql)); { ?> <?php $zajedno=$row['Artist']."- ".$row['Song']; echo "<font size=3><font color=white><b>Download </b></a> </font></font>"; echo "<font size=4><font color='#A49F8B'><a href=\"{$row['Link']}\"><font color='#A49F8B'>$zajedno</font></font></a>"; echo "<font size=3><font color=white><b> Music Video</b> </a> </font></font>"; } php?> Hvala vam unapred! |