Skip to content

Commit

Permalink
Added HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
BaileyJM02 committed Jan 12, 2018
1 parent f3b7df3 commit e26ccdc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
// set title and description for this page
$title = "Site Toplist";
$dc = "Free top list and link exchange at ".$sname;
// print out page headers
?>
<h2 class=\"center\">Top Sites</h2>
<a href="add">Add</a> - <a href="cp.sec">Admin</a>
<br /><br />
<?php
// required function
function dehtml($html) {
return htmlentities($html, ENT_QUOTES, 'utf-8');
Expand Down Expand Up @@ -42,17 +48,17 @@ function dehtml($html) {
$first_message = ($page-1)*$nb_site_page;
$last_message = $first_message +$nb_site_page;
$i = $first_message ;
// print out page headers
echo "<h2 class=\"center\">Top Sites</h2>";

//fetch data from database
$req2 = mysql_query('SELECT * FROM `topsite` WHERE status="ok" ORDER BY `clicks` DESC LIMIT '.$first_message .','.$last_message);
//$req2 = mysql_fetch_object($req2);
while($dnn2 = mysql_fetch_array($req2)) {
$i++;
echo "<div style=\"border:2px solid blue\">";
echo $i.") ";
echo "<td class=\"site\"><a href=/click.php?id=".(dehtml($dnn2['id']))."&url=".(dehtml($dnn2['url'])).">" . (dehtml($dnn2['name'])). "</a><br />";
echo (dehtml($dnn2['description'])). "<br /></div>";
echo "<td class=\"site\"><a href=/click/?id=".(dehtml($dnn2['id']))."&url=".(dehtml($dnn2['url'])).">" . (dehtml($dnn2['name'])). "</a> - <a href=/stats/?id=".(dehtml($dnn2['id']))."&url=".(dehtml($dnn2['url'])).">Stats</a><br />";
echo (dehtml($dnn2['description'])). "<br />";
echo "</div>";

}
//We display pages site (again)
Expand Down

0 comments on commit e26ccdc

Please sign in to comment.