<html> <head> <link href="/textpattern/textpattern.css" rel="Stylesheet" type="text/css" /> </head> <body> <?php require_once("textpattern/config.php"); mysql_connect($txpcfg['host'], $txpcfg['user'], $txpcfg['pass']) or die(mysql_error()); mysql_select_db($txpcfg['db']) or die(mysql_error()); // Quote variable to make safe function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = mysql_real_escape_string($value); } return $value; } $sql = "SELECT * FROM " .$txpcfg['table_prefix'] ."txp_log WHERE host LIKE '%" .quote_smart($_GET['host']) ."%' ORDER BY 'time' DESC LIMIT 0, 30 "; $result = mysql_query($sql) or die(mysql_error()); echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id=\"list\" align=\"center\">"; echo "<tr><td><b>Time</b></td><td><b>host</b></td><td><b>page</b></td></tr>"; while($row = mysql_fetch_array($result)) { echo "<tr><td>".$row['time']."</td><td>".$row['host']."</td><td>".$row['page']."</td></tr>"; } echo "</table>"; ?> </body></html>
You need to create an account or log in to post comments to this site.