Ребята Помогите запихнуть Два скрипта,пробовал не получается ибо руки кривые =(
Что надо пихнуть:
http://www.php.su/articles/?cat=examples&page=062
http://code-live.ru/post/custom-search-for-site-with-php-and-mysql/
Куда надо запихать:
Что надо пихнуть:
http://www.php.su/articles/?cat=examples&page=062
http://code-live.ru/post/custom-search-for-site-with-php-and-mysql/
Куда надо запихать:
PHP:
<?php require_once('Connections/db.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_ctbans, $ctbans);
$query_ctbans = "SELECT perp_name, admin_name, bantime, timeleft, reason FROM CTBan_Log";
$ctbans = mysql_query($query_ctbans, $ctbans) or die(mysql_error());
$row_ctbans = mysql_fetch_assoc($ctbans);
$totalRows_ctbans = mysql_num_rows($ctbans);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CT BAN</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div style="top: -50px; left: 298px; z-index: 2; position: absolute;">
<nav>
<ul>
<li><a href="http://deadly-bullet.ru/">Наш Сайт</a></li>
<li><a href="http://deadly-bullet.ru/forum">Наш Форум</a></li>
<li><a href="http://deadly-bullet.ru/bans/index.php?p=banlist">Бан-Лист</a></li>
<li><a href="https://vk.com/clubjsmerti">Группа ВК</a></li>
<li><a href="http://deadly-bullet.ru/contakti.html">Контакты</a></li>
</ul>
</nav>
</div>
<div style="top: 150px; left: 277px; z-index: 2; position: absolute;">
<table class="bordered">
<thead>
<tr>
<th>Игрок</th>
<th>Ник Администратора</th>
<th>Время бана</th>
<th>Заканчивается</th>
<th>Причина</th>
<?php do{?>
<tr>
<td><?php echo $row_ctbans['perp_name'];?></td>
<td><?php echo $row_ctbans['admin_name'];?></td>
<td><?php if($row_ctbans['bantime'] == "0") {echo "навсегда";} else
if($row_ctbans['bantime'] == "-1") {echo "срок вышел";} else
echo $row_ctbans['bantime']; ?></td>
<td><?php if($row_ctbans['timeleft'] == "0") {echo "никогда";} else
if($row_ctbans['timeleft'] == "-1") {echo "Разбанен";} else
echo $row_ctbans['timeleft']; ?></td>
<td><?php echo $row_ctbans['reason'];?></td>
</tr>
<?php }while($row_ctbans=mysql_fetch_assoc($ctbans));?>
</div>
</body>
</html>
<?php
mysql_free_result($ctbans);
?>