setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (Exception $e) { // db problem exit(); } header("Pragma: no-cache"); header("Cache-control: no-cache"); function xmlentities($string) { $string = str_replace("&", "&", $string); $string = preg_replace('/[^\x09\x0A\x0D\x20-\x7F]/e', '_privateXMLEntities("$0")', $string); return $string; } function _privateXMLEntities($num) { $chars = array( 128 => '€', 130 => '‚', 131 => 'ƒ', 132 => '„', 133 => '…', 134 => '†', 135 => '‡', 136 => 'ˆ', 137 => '‰', 138 => 'Š', 139 => '‹', 140 => 'Œ', 142 => 'Ž', 145 => '‘', 146 => '’', 147 => '“', 148 => '”', 149 => '•', 150 => '–', 151 => '—', 152 => '˜', 153 => '™', 154 => 'š', 155 => '›', 156 => 'œ', 158 => 'ž', 159 => 'Ÿ'); $num = ord($num); return (($num > 127 && $num < 160) ? $chars[$num] : "&#".$num.";" ); } header("Content-Type: application/rss+xml"); echo "<" . "?xml version=\"1.0\"?" . ">"; echo ""; echo ""; echo "IPv6-test.com - Recently validated sites"; echo "http://ipv6-test.com/"; echo ""; echo "IPv6-test.com - Recently validated sites"; $q = $db->query("select * from webtests order by id desc limit 100"); $q->setFetchMode(PDO::FETCH_OBJ); foreach ($q->fetchAll() as $wt) { $url = xmlentities($wt->url); echo "\n"; echo ""; echo xmlentities($wt->hostname); echo "\n"; echo "" . date("r", $wt->datetime) . "\n"; echo "{$url}\n"; echo "{$url}\n"; echo ""; echo "<img src=\"http://www.robothumb.com/src/?size=100x75&url=" . xmlentities($url) . "\" />"; if ($wt->descr) echo "<br />" . xmlentities($wt->descr); echo ""; echo "\n"; if (++$nb_items >= 100) break; } echo ""; echo ""; ?>