Я вставляю код, и все ок, только он находится над сайтом, можно вниз прокрутить и появится сам сайт и в самом низу такая ошибка
Fatal error: Call to a member function close() on a non-object in /home/mirabl/public_html/index.php on line 234
вот 234 строка
$db->close();
Сам код
Код:
<?php
$icq=$_POST['icq'];
$email=strip_tags(htmlspecialchars($_POST['email']));
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>OnLine ICQ-Base</title>
<style type="text/css">
A {text-decoration: none;}
A:link, A:active, A:visited {color: blue;}
A:hover {text-decoration: underline;}
</style>
<script language="JavaScript"><!--
function reset_form() {
document.forms[0].elements[0].value="";
document.forms[0].elements[1].value="";
}
//--></script>
</head>
<body bgcolor="#FAFAF5">
<table border="0" width="100%" height="100%" align="center">
<tr valign="top"><td>
<h1 align="center"><span style="color:red;">OnLine</span> <span style="color:green;">ICQ</span>-<span style="color:orange;">Base</span></h1>
</td></tr>
<tr><td valign="middle">
<p align="center"><table border="1" align="center" bordercolor="#000000" cellpadding="3" cellspacing="2">
<tr><td><b>ICQ:</b></td><td><form name="icq" action="index.php" method="post"><input type="text" name="icq" size="20" maxlength="6" value="<?php echo $icq; ?>"></td></tr>
<tr><td><b>E-mail:</b></td><td><input type="text" name="email" size="20" maxlength="60" value="<?php echo $email; ?>"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Search"> <input type="button" onclick="reset_form()" value="Reset"></form></td></tr>
</table>
<br>
<i>Возможен поиск по маске (<b>?</b> или <b>*</b>)</i></p>
<?php
// *****Настройки*****
$hostname="localhost"; // Адрес MySQL-сервера;
$user="root"; // Логин;
$password=""; // Пароль;
$db=""; // Имя базы данных;
$limit=250; // Лимит выводимых результатов за раз;
// ********Код********
if ((isset($icq) and isset($email)) and ($icq!="" or $email!="" )) {
if (($icq>99999 and $icq<1000000) or ($icq=="" and $email!="") or (strchr($icq,"*") or strchr($icq,"?"))) {
if (strlen($email)>2 or ($email=="" and $icq!="") or (strchr($email,"*") or strchr($email,"?"))) {
if (@mysql_connect($hostname,$user,$password)) {
@mysql_select_db($db);
// Защита от SQL-инъекций
$icq=@mysql_escape_string($icq);
$email=@mysql_escape_string($email);
//***********************
// Удаление псевдо-маски
$icq=str_replace("%","\%",$icq);
$icq=str_replace("_","\_",$icq);
$email=str_replace("%","\%",$email);
$email=str_replace("_","\_",$email);
// Применения маски поиска
$icq=str_replace("*","%",$icq);
$icq=str_replace("?","_",$icq);
$email=str_replace("*","%",$email);
$email=str_replace("?","_",$email);
if ($icq!="" and $email!="") {$where="uin LIKE '$icq' and prim_mail LIKE '$email'";}
else {
if ($icq!="") {$where="uin LIKE '$icq'";}
if ($email!="") {$where="prim_mail LIKE '$email'";}
}
$result=@mysql_query("SELECT * FROM icq_2002 WHERE ($where) order by uin limit $limit");
$rows=@mysql_num_rows($result);
if ($rows!=0) {
echo <<<EOF
<p align="center"><table border="0" align="center" bgcolor="silver" cellpadding="25" cellspacing="5"><tr><td>
<code style="color:#000000;">
EOF;
$i=0;
while ($i<$rows) {
@mysql_data_seek($result,$i);
$icq=@mysql_fetch_array($result);
$uin=$icq["uin"];
$email=htmlspecialchars($icq["prim_mail"]);
echo <<<EOF
$uin<b style="color:blue;">:</b>$email<br>\n
EOF;
$i++;
}
echo <<<EOF
</code>
</td></tr></table></p>
EOF;
echo "\n<h3 align=\"center\" style=\"color:blue;\">Всего найдено: $rows</h3>\n";
} // if $rows!=0
else {
if ((strchr($icq,"%") or strchr($icq,"_")) or (strchr($email,"%") or strchr($email,"_"))) {
echo "\n<h3 align=\"center\" style=\"color:blue;\">Всего найдено: $rows</h3>\n";
echo "\n<h3 align=\"center\" style=\"color:red;\">Попробуйте задать другую маску!</h3>\n";
}
else {echo "\n<h3 align=\"center\" style=\"color:red;\">Такого номера ICQ или E-mail нет в нашей базе!</h3>\n";}
} // else: $rows!=0
}
else {echo "<h3 align=\"center\" style=\"color:red;\">Не могу приконнектиться к базе!</h3>";}
@mysql_free_result($result); // освобождает память
@mysql_close();
} // if $email>3
else {echo "<h3 align=\"center\" style=\"color:red;\">Длинна E-mail`а должна быть >2 символов!</h3>";}
} // if $icq>99999 or $icq<1000000
else {echo "<h3 align=\"center\" style=\"color:red;\">В нашей базе ТОЛЬКО шестизначки (100000-999999)!</h3>";}
} // if $icq and $email not empty
?>
</td></tr>
<tr valign="bottom"><td align="center">
<br>
<p align="center"><small><b>Copyright © 2004 <a href="http://www.web-hack.ru" target="_blank">WEB-HACK</a>. Powered by <a href="http://www.xakepok.org" target="_blank">XSS-ICQ</a></b></small></p>
</td></tr>
</table>
</body>
</html>
|