что за ощибка???

Discussion in 'PHP' started by selevit, 28 Aug 2009.

  1. selevit

    selevit Banned

    Joined:
    19 Aug 2009
    Messages:
    95
    Likes Received:
    9
    Reputations:
    -3
    Всем доброго времени суток, я написал скрипт поиска для своего сайта, но при его запуске выходит ошибка:

    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>
     
  2. eLWAux

    eLWAux Elder - Старейшина

    Joined:
    15 Jun 2008
    Messages:
    860
    Likes Received:
    616
    Reputations:
    211
    Code:
    while ($myrow = mysql_fetch_array($result));[color=red][size=8][b]}[/b][/color][/size]?>
     
    1 person likes this.
  3. gisTy

    gisTy Elder - Старейшина

    Joined:
    24 May 2008
    Messages:
    432
    Likes Received:
    160
    Reputations:
    27
    просто ты забыл закрыть фигурную скобку
    Code:
    <?php
    		 if (mysql_num_rows($result) > 0)
    
    {           [color="red"] <-------[/color]1 открыл
    $myrow = mysql_fetch_array($result);
    
    do
    {[color="red"] <-------[/color]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']);
    
    
    }[color="red"] <-------[/color]2 закрыл
    
    while ($myrow = mysql_fetch_array($result));?>
       
            
            </td>
          </tr>
        </table></td>
      </tr>
    <?php include ("blocks/footer.php");?>
    </table>
    </body>
    </head>
    </html>
    
    а один не закрыл
     
  4. selevit

    selevit Banned

    Joined:
    19 Aug 2009
    Messages:
    95
    Likes Received:
    9
    Reputations:
    -3
    Спасибо!!!
     
  5. selevit

    selevit Banned

    Joined:
    19 Aug 2009
    Messages:
    95
    Likes Received:
    9
    Reputations:
    -3
    Разобрался
     
    #5 selevit, 29 Aug 2009
    Last edited: 29 Aug 2009