У меня есть поиск он ищет и выводит результат верный просто внизу страницы, а не сразу под шапкой сайта. Помогите пожалуйста не знаю что еще сделать Главная in.php Код | <html > <head> <meta http-equiv='Content-Type' content='text/html; charset=windows-1251'> <title>Мир фантазий </title> <style > <!-- #wrapper{ width: 100%; height: 100%; } #head{ background-image: url('http://i66.fastpic.ru/big/2014/1129/f9/a4248db893dadc13ac1d94a4080a77f9.jpg') ; width: 100%; height: 150px; } #nav{ background: #d0cba3 ; height: 30px; } #nav li{ display: inline-block; } #nav a{ text-decoration: none; color: #fff; } #sidebar{ height: 100%; background-color: #FFFAFA; margin-bottom: 10px; width: 95%; float: right; } --> </style> </head> <body bgcolor ="#FFFAFA"> <div id="wrapper"> <div id="head"> </div> <div id="nav"> <ul id="links"> <li><a href="index.php">Главная </a></li> <? $categoris = get_cat(); foreach ($categoris as $item):?> <li><a href="index.php?view=cat&id=<? echo $item['Cat_id'];?>"><?PHP echo $item['Nazvanie'];?></a></li> <?endforeach;?> <li> Поиск автора </li> <li> <form action="poi.php" METHOD="POST" name="search" > <input input type="text" name="user" > <input type="submit" name="button" value="Найти" ></form> </li> </ul> </div> <div id="sidebar"> <?PHP
$fPath = $_SERVER['DOCUMENT_ROOT'].'/userfiles/sha/'.$view.'.php'; if(file_exists($fPath)) { include($fPath); } ?> </div> </div> </body> </html>
|
poi.php Код |
<?php
include ('db.php');
include($_SERVER['DOCUMENT_ROOT'].'/userfiles/sha/in.php');
$button = @$_POST['button']; $user = @$_POST['user'];
if ($button == 'Найти') { $query = "SELECT * FROM knigi where Avtor LIKE '%{$user}%'"; $result = mysql_query($query) or trigger_error(mysql_errno() . ' ' . mysql_error() . ' query: ' . $sql); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { echo " {$row['Avtor']} <br> {$row['Nazvanie']}<br> {$row['Opisanie']}<br> {$row['Kol_str']}<br>"; } } else { echo 'Nety'; } }
?>
|
Это сообщение отредактировал(а) Катя435 - 21.12.2014, 22:09
|