File size: 760B
<?php
error_reporting(0);
include 'valid.php';
include 'GS.class.php';
$q = isset($_GET['q']) && !empty($_GET['q']) ? strip_tags($_GET['q']) : $s[0];
$p = isset($_GET['p']) && $_GET['p'] > 0 ? (int)$_GET['p'] : 0;
$GS = new Gsearch();
$GS -> user_ip = $_SERVER['REMOTE_ADDR'];
$GS -> search = urlencode($q);
$GS -> start = ($p * 8);
$GS -> safe = isset($_GET['safe']) && in_array(strtolower($_GET['safe']), $safe) ? $_GET['safe'] : "off";
$GS -> image_size = isset($_GET['size']) && in_array(strtolower($_GET['size']), $image_size) ? $_GET['size'] : "";
$GS -> image_type = isset($_GET['type']) && in_array(strtolower($_GET['type']), $image_type) ? $_GET['type'] : "";
$data = $GS -> exec();
if (!$data)
die("No results to show.");
include "html.tpl.php";
?>