Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
 |

28.08.2009, 23:23
|
|
Banned
Регистрация: 19.08.2009
Сообщений: 104
Провел на форуме: 247293
Репутация:
23
|
|
что за ощибка???
Всем доброго времени суток, я написал скрипт поиска для своего сайта, но при его запуске выходит ошибка:
Parse error: parse error, unexpected $end in p:\home\localhost\www\softolom_blog.com\search.php on line 135
вот сама страница со скриптом:
Код HTML:
<?php include ("blocks/bd.php");
if(isset($_POST['submit_s'])) {$submit_s = $_POST['submit_s'];}
if(isset($_POST['search'])) {$search = $_POST['search'];}
if(isset($submit_s))
{
if(empty($search) || strlen($search) < 4)
{
echo
"<html>
<head>
<meta http-equiv='Refresh' content='0; URL=index.php'>
</html>
</head>";
$search = trim($search);
$search = stripslashes($search);
$search = htmlspecialchars($search);
$result = mysql_query("SELECT id, title, desctiption, date, author, view, download FROM data WHERE MATCH(text) AGAINST('$search')",$db);
}
}
else
{
echo
"<html>
<head>
<meta http-equiv='Refresh' content='0; URL=index.php'>
</html>
</head>";
}
$result = mysql_query("SELECT title,meta_d,meta_k,text FROM settings WHERE page = 'index'", $db);
if(!$result) {
echo "<center><b><p>Запрос на выборку данных из базы не прошел, напишите об этом администратору на email: selevit@yandex.ru или в ICQ:375766234<br><strong>Код ошибки:
<br></strong></p></b></center>";
exit(mysql_error());
}
if (mysql_num_rows($result) > 0)
{
$myrow = mysql_fetch_array($result);
}
else
{
echo "<strong><p><center>Инфотмация по запросу не может быть извлечена, так как в таблице БД нет записей</center></p></strong>";
exit();
}
?>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="main_border">
<?php include ("blocks/header.php");?>
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="top" id="s">
<tr>
<?php include ("blocks/left_td.php");?>
<td width="77%" align="left" valign="top">
<p class="nav_title">Поиск</p>
<?php
if (mysql_num_rows($result) > 0)
{
$myrow = mysql_fetch_array($result);
do
{
printf (" <table align='center' class='post'>
<tr>
<td>
<p class = 'nav_link'><a href='view_post.php?id=%s'>%s</a>
<p class = 'post_adds'>Дата Добавления: %s</p>
<p class = 'post_adds'>Добавил: %s</p>
</td>
</tr>
<tr>
<p><td>%s
<p class = 'post_view'>Просмотров: %s</p>
<p class = 'post_view'>Загрузок: %s</p>
</tr>
</table>", $myrow['id'], $myrow['title'], $myrow['date'], $myrow['author'], $myrow['description'], $myrow['view'], $myrow['download']);
}
while ($myrow = mysql_fetch_array($result));?>
</td>
</tr>
</table></td>
</tr>
<?php include ("blocks/footer.php");?>
</table>
</body>
</head>
</html>
|
|
|

28.08.2009, 23:29
|
|
Members of Antichat - Level 5
Регистрация: 15.06.2008
Сообщений: 941
Провел на форуме: 5111568
Репутация:
2399
|
|
Код:
while ($myrow = mysql_fetch_array($result));}?>
|
|
|

28.08.2009, 23:32
|
|
Постоянный
Регистрация: 24.05.2008
Сообщений: 589
Провел на форуме: 3629857
Репутация:
504
|
|
просто ты забыл закрыть фигурную скобку
Код:
<?php
if (mysql_num_rows($result) > 0)
{ <-------1 открыл
$myrow = mysql_fetch_array($result);
do
{ <-------2 открыл
printf (" <table align='center' class='post'>
<tr>
<td>
<p class = 'nav_link'><a href='view_post.php?id=%s'>%s</a>
<p class = 'post_adds'>Дата Добавления: %s</p>
<p class = 'post_adds'>Добавил: %s</p>
</td>
</tr>
<tr>
<p><td>%s
<p class = 'post_view'>Просмотров: %s</p>
<p class = 'post_view'>Загрузок: %s</p>
</tr>
</table>", $myrow['id'], $myrow['title'], $myrow['date'], $myrow['author'], $myrow['description'], $myrow['view'], $myrow['download']);
} <-------2 закрыл
while ($myrow = mysql_fetch_array($result));?>
</td>
</tr>
</table></td>
</tr>
<?php include ("blocks/footer.php");?>
</table>
</body>
</head>
</html>
а один не закрыл
|
|
|

28.08.2009, 23:33
|
|
Banned
Регистрация: 19.08.2009
Сообщений: 104
Провел на форуме: 247293
Репутация:
23
|
|
Спасибо!!!
|
|
|

29.08.2009, 00:07
|
|
Banned
Регистрация: 19.08.2009
Сообщений: 104
Провел на форуме: 247293
Репутация:
23
|
|
Разобрался
Последний раз редактировалось selevit; 29.08.2009 в 08:41..
|
|
|
|
 |
Похожие темы
|
| Тема |
Автор |
Раздел |
Ответов |
Последнее сообщение |
|
Анеки=)
|
porter |
Болталка |
25 |
25.11.2006 21:10 |
|
Правда о докторе Айболите
|
Дрэгги |
Болталка |
17 |
30.09.2006 13:34 |
|
Майкл Делл
|
novichok |
Чужие Статьи |
0 |
29.03.2006 21:51 |
|
Пиянство
|
mifan |
Болталка |
18 |
03.09.2004 12:36 |
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|