Здравейте
Сложих си една търсачка в сайта но... не мога да си направя резултатите да ги подрежда в таблица.... искам нещо таковаа да се получи
http://web-tourist.net/project/centrino/iazneznam.jpg да е разграфено ето така но не мога нещо не се получава.. резултатите ги разхвърля..... ако някой може да ми помогне ще съм много благодарен, а ето така е в момента
http://91.139.203.162/site/search.php за да пробвате напишете "anti"и ще видите как ще ви извади резултатите. Ето и сорс кода на страницата
http://web-tourist.net/project/centrino/iazneznam.jpg да е разграфено ето така но не мога нещо не се получава.. резултатите ги разхвърля..... ако някой може да ми помогне ще съм много благодарен, а ето така е в момента
Код:
<?php
include "config.php";
//Set the page size
$StartRow = 0;
//Set the page no
if(empty($_GET['PageNo'])){
if($StartRow == 0){
$PageNo = $StartRow + 1;
}
}else{
$PageNo = $_GET['PageNo'];
$StartRow = ($PageNo - 1) * $PageSize;
}
//Set the counter start
if($PageNo % $PageSize == 0){
$CounterStart = $PageNo - ($PageSize - 1);
}else{
$CounterStart = $PageNo - ($PageNo % $PageSize) + 1;
}
//Counter End
$CounterEnd = $CounterStart + ($PageSize - 1);
?>
<!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=windows-1251" />
<title>Free Search</title>
<style type="text/css">
body
{
margin-left:37px;
margin-top: 50px;
margin-right:50px;
margin-bottom: 50px;
padding:0px;
background-image: url('bqbg.jpg');
background-repeat: repeat-x
}
/*Nav*/
#chromemenu{
margin-top: 65px;
margin-left: 0px;
position:absolute;
width: 928px;
font-weight: bold;
font-size: 90%;
}
#chromemenu:after{
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#chromemenu ul{
border: 1px solid #BBB;
width: 100%;
background: url('chromebg.gif') center center repeat-x;
padding: 5px 0;
margin: 0;
text-align: center;
}
#chromemenu ul li{
display: inline;
}
#chromemenu ul li a{
color: #494949;
padding: 5px;
margin: 0;
text-decoration: none;
border-right: 1px dashed #DADADA;
}
#chromemenu ul li a:hover{
background: url('chromebg2.gif') center center repeat-x;
}
/*Head Down*/
.headdown {
position: absolute;
margin-bottom: auto;
margin-left: auto;
margin-right: auto;
margin-top: 65px;
width: 930px;
height: 37px;
background-image: url('bluebg_bg.gif');
background-repeat: repeat;
}
/*Header*/
.header {
position: absolute;
margin-bottom: auto;
margin-left: auto;
margin-right: auto;
margin-top: -42px;
width: 930px;
height: 60px;
background-image: url('bg_head.gif');
background-repeat: repeat-x;
}
/*downer*/
.downer {
position: absolute;
margin-bottom: px;
margin-left: auto;
margin-right: auto;
margin-top: 680px;
width: 930px;
height: 21px;
background-image: url('bg_head.gif');
background-repeat: repeat-x;
}
/*Head*/
.head {
position: absolute;
margin-bottom: auto;
margin-left: auto;
margin-right: auto;
margin-top: -15px;
width: 930px;
height: 80px;
background-image: url('dellbg.jpg');
background-repeat: repeat;
}
/*left*/
.left {
position:absolute;
margin-top: 95px;
float:left;
width:120px;
height:530px;
border-right:1px dashed #666666;
border-left:1px dashed #666666;
background-image: url('bg_head.gif');
background-repeat: repeat;
}
/*center container*/
.center {
position: absolute;
margin-top: 95px;
margin-left: 130px;
margin-right: 100px;
margin-bottom: 100px;
width:668px;
height:530px;
border-top:1px dashed #666666;
border-bottom:1px dashed #666666;
background-image: url('bg_head.gif');
background-repeat: repeat;
}
/*novini*/
.novini{
position: absolute;
margin-top: 150px;
margin-left: 150px;
margin-right: auto;
margin-bottom: auto;
width:300px;
height:300px;
border-top-style:solid;
border-top-color:#ffffff;
border-top-width:thin;
border-bottom-style:solid;
border-bottom-color:#ffffff;
border-bottom-width:thin;
border-right-style:solid;
border-right-color:#ffffff;
border-right-width:thin;
border-left-style:solid;
border-left-color:#ffffff;
border-left-width:thin;
background-image: url('bg_head.gif');
background-repeat: repeat;
}
/*poslednitemi*/
.poslednitemi {
position: absolute;
margin-top: 150px;
margin-left: 475px;
margin-right: auto;
margin-bottom: auto;
width:300px;
height:300px;
border-top-style:solid;
border-top-color:#ffffff;
border-top-width:thin;
border-bottom-style:solid;
border-bottom-color:#ffffff;
border-bottom-width:thin;
border-right-style:solid;
border-right-color:#ffffff;
border-right-width:thin;
border-left-style:solid;
border-left-color:#ffffff;
border-left-width:thin;
background-image: url('bg_head.gif');
background-repeat: repeat;
}
/*right*/
.right {
position:absolute;
margin-top: 95px;
margin-left: 807px;
float:right;
width:120px;
height:530px;
border-right:1px dashed #666666;
border-left:1px dashed #666666;
background-image: url('bg_head.gif');
background-repeat: repeat;
}
/*left menu*/
.leftmenu {
position:absolute;
margin-top: 98px;
margin-left: 810px;
float:right;
width:113px;
height:20px;
border-style: solid;
border-color: white;
border-width: thin;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*right menu down*/
.rightmenudown {
position:absolute;
margin-top: 123px;
margin-left: 811px;
float:right;
width:113px;
height:96px;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*right menu*/
.rightmenu {
position:absolute;
margin-top: 98px;
margin-left: 3px;
float:left;
width:113px;
height:20px;
border-style: solid;
border-color: white;
border-width: thin;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*novini menu*/
.novinimenu {
position:absolute;
margin-top: 125px;
margin-left: 150px;
float:left;
width:300px;
height:20px;
border-style: solid;
border-color: white;
border-width: thin;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*novini menu right*/
.novinimenuright {
position:absolute;
margin-top: 125px;
margin-left: 475px;
float:left;
width:300px;
height:20px;
border-style: solid;
border-color: white;
border-width: thin;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*center menu*/
.centermenu {
position:absolute;
margin-top: 98px;
margin-left: 134px;
float:left;
width:657px;
height:20px;
border-style: solid;
border-color: white;
border-width: thin;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*button Vhod*/
.vhod {
cursor:pointer;
position:absolute;
margin-top: 170px;
margin-left: 884px;
foat:right;
width: 40px;
height: 22px;
}
/*button reg*/
.reg {
cursor:pointer;
position:absolute;
margin-top: 193px;
margin-left: 844px;
foat:right;
width: 40px;
height: 22px;
}
/*left menu reklama*/
.leftmenureklama {
position:absolute;
margin-top: 223px;
margin-left: 811px;
float:right;
width:113px;
height:20px;
border-style: solid;
border-color: white;
border-width: thin;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*left reklama*/
.leftreklama {
position:absolute;
margin-top: 249px;
margin-left: 811px;
float:right;
width:113px;
height:370px;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*right menu down*/
.leftmenudown {
position:absolute;
margin-top: 123px;
margin-left:5px;
float:left;
width:113px;
height:96px;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*priqteli*/
.priqteli {
position:absolute;
margin-top: 223px;
margin-left: 3px;
float:left;
width:113px;
height:20px;
border-style: solid;
border-color: white;
border-width: thin;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*priqteli down*/
.priqtelidown {
position:absolute;
margin-top: 249px;
margin-left:5px;
float:left;
width:113px;
height:370px;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
/*tarsa4ka*/
.tarsa4ka {
position:absolute;
margin-top: 125px;
margin-left: 134px;
float:left;
width:657px;
height:60px;
border-style: solid;
border-color: white;
border-width: thin;
background-image: url('bg_menu.gif');
background-repeat: repeat;
}
</style>
<script language="JavaScript" type="text/JavaScript">
</script>
</head>
<body>
<div class="header">
<center><b><code>Безплатно търсене в много български и чуждестранни сървари</code></b></center>
</div>
<div class="head">
</div>
<div id="chromemenu">
<ul>
<li><a href="">Начало</a></li>
<li><a href="">Търсачка</a></li>
<li><a href="">Добавяне на линкове</a></li>
<li><a href="">Google Търсачка NEW</a></li>
<li><a href="">Регистрация</a></li>
<li><a href="">Форум</a></li>
<li><a href="">Реклама</a></li>
<li><a href="">Контакти</a></li>
</ul>
</div>
<div class="left">
</div>
<div class="center">
<p> </p>
<p> </p>
</div>
<div class="downer">
<center><b><code>За реклама | Правила | Дизайн:Дацко Дацев</code></b></center>
</div>
<div class="right">
</div>
<div class="rightmenu">
<center><b><code>Статистика</code></b></center>
</div>
<div class="leftmenudown">
<center><samp><b>Добавени</b></samp></center>
<b><code>Днес:</code></b><br />
<b><code>Общо:</code></b><br />
</div>
<div class="priqteli">
<center><b><code>Приятели</code></b></center>
</div>
<div class="priqtelidown">
</div>
<div class="leftmenu">
<center><b><code>Вход</code></b></center>
</div>
<div class="rightmenudown">
<form>
<input type="text" size="15" name="name" onfocus="this.value=''" class="subtext" value="Потребител" />
<input type="password" size="15" name="password" onfocus="this.value=''" class="subtext" value="Парола" />
<br />
</form>
</div>
<div class="vhod">
<a href="link"> <img src="button_vhod.jpg" width="40" height="22" border="0" /></a>
</div>
<div class="reg"> <img src="button_reg.jpg" width="80" height="22" />
</div>
<div class="leftmenureklama">
<center><b><code>Реклама</code></b></center>
</div>
<div class="leftreklama">
</div>
<div class="centermenu">
<font color="#ffffff" size="4"><center><b><code>Търсачка</code></b></center></font>
</div>
<div class="tarsa4ka">
<form method="GET" action="">
<form>
<code>Име на файл:</code>
<input type="text" name="q" size="30">
<input type="submit" value="Търсене">
<p> </p>
</form>
<?php
$tarsene = $_GET['q'];
if($_GET['q'])
{
$trimmed = trim($tarsene);
$var = explode(" ",$trimmed);
$count = count($var);
for($i = $count-1;$i < sizeof($var); $i++) {
$abc = $var[$i];
mysql_connect($server, $dbusername, $dbpassword)or die("Сайтът не може да се свърже към базата данни");
@mysql_select_db($db_name) or die("Грешна база данни");
$TRecord = mysql_query("SELECT * FROM `linkove` WHERE `files` LIKE '%$abc%'");
$result = mysql_query("SELECT * FROM `linkove` WHERE `files` LIKE '%$abc%' ORDER BY `id` DESC LIMIT $StartRow,$PageSize");
//Total of record
$RecordCount = mysql_num_rows($TRecord);
//Set Maximum Page
$MaxPage = $RecordCount % $PageSize;
if($RecordCount % $PageSize == 0){
$MaxPage = $RecordCount / $PageSize;
}else{
$MaxPage = ceil($RecordCount / $PageSize);
}
?>
<table width="100%" border="0" class="InternalHeader">
<tr>
<td width="24%"></td>
<td width="76%">
<div align="right">
<?php print "$RecordCount запис(а) намерен(и) - Вие сте на страница $PageNo от $MaxPage" ?></div>
</td>
</tr>
</table>
<br>
<table width="100%" border="0" class="NormalTableTwo">
<tr>
<td class="InternalHeader" width="5%">Номер</td>
<td class="InternalHeader" width="60%">Име</td>
<td class="InternalHeader" width="20%">Тип</td>
<td class="InternalHeader" width="15%">Добавен</td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
$id=$row[id];
$data=$row[data];
$fulllinks=$row[fulllinks];
$files=$row[files];
$tipfail=$row[tipfail];
$bil = $i + ($PageNo-1)*$PageSize;
?>
<tr>
<td class="NormalFieldTwo" width="5%"><?php echo $bil ?></td>
<td class="NormalFieldTwo" width="60%"><a href="s.php?id=<?php echo $id; ?>" target="_new"><?php echo $files ?></a></td>
<td class="NormalFieldTwo" width="20%"><?php echo $tipfail ?></td>
<td class="NormalFieldTwo" width="15%"><?php echo $data ?></td>
</tr>
<?php
$i++;
}?>
</table><br>
<table width="100%" border="0" class="InternalHeader">
<tr>
<td>
<div align="center">
<?php
//Print First & Previous Link is necessary
if($CounterStart != 1){
$PrevStart = $CounterStart - 1;
print "<a href=?q=$tarsene&PageNo=1>Първи </a>: ";
print "<a href=?q=$tarsene&PageNo=$PrevStart>Предишни $PageSize </a>";
}
print " [ ";
$c = 0;
//Print Page No
for($c=$CounterStart;$c<=$CounterEnd;$c++){
if($c < $MaxPage){
if($c == $PageNo){
if($c % $PageSize == 0){
print "$c ";
}else{
print "$c ,";
}
}elseif($c % $PageSize == 0){
echo "<a href=?q=$tarsene&PageNo=$c>$c</a> ";
}else{
echo "<a href=?q=$tarsene&PageNo=$c>$c</a> ,";
}//END IF
}else{
if($PageNo == $MaxPage){
print "$c ";
break;
}else{
echo "<a href=?q=$tarsene&PageNo=$c>$c</a> ";
break;
}//END IF
}//END IF
}//NEXT
echo "] ";
if($CounterEnd < $MaxPage){
$NextPage = $CounterEnd + 1;
echo "<a href=?q=$tarsene&PageNo=$NextPage>Следващи $PageSize</a>";
}
//Print Last link if necessary
if($CounterEnd < $MaxPage){
$LastRec = $RecordCount % $PageSize;
if($LastRec == 0){
$LastStartRecord = $RecordCount - $PageSize;
}
else{
$LastStartRecord = $RecordCount - $LastRec;
}
print " : ";
echo "<a href=?q=$tarsene&PageNo=$MaxPage>Последни</a>";
}
?>
</div>
</td>
</tr>
</table>
<?php
mysql_free_result($result);
mysql_free_result($TRecord);
}}
?>
</div>
<div id="Layer2" style="position:absolute; left:456px; top:47px; width:430px; height:60px; z-index:2">РЕКЛАМА</div>
</body>
</html>