Parse error

kitchenbg

Registered
какво трябва да направя че да не ми излиза това?
Код:
Parse error: syntax error, unexpected '[', expecting ')' in /users/kitchenb/public_html/proba/recepies.php on line 106
а ето и кода който ползвам
Код:
<?php function tut_stars($row_rsRecepies['rating_art'];){ 
    if((($row_rsRecepies['rating_art'] >= 0)or($row_rsRecepies['rating_art'] == 1)) && ($row_rsRecepies['rating_art'] <= 0.99)){ 
        echo "<img src="image/1point_kl.gif" width="10" height="10">"; 
    }  
    if((($row_rsRecepies['rating_art'] >= 1.00)or($row_rsRecepies['rating_art'] == 2.00)) && ($row_rsRecepies['rating_art'] <= 1.99)){ 
        echo "<img src="image/2point_kl.gif" width="70" height="18">"; 
    } 
    if((($row_rsRecepies['rating_art'] >= 2.00)or($row_rsRecepies['rating_art'] == 3.00)) && ($row_rsRecepies['rating_art'] <= 2.99)){ 
        echo "<img src="image/3point_kl.gif" width="70" height="18">"; 
    } 
    if((($row_rsRecepies['rating_art'] >= 3.00)or($row_rsRecepies['rating_art'] == 4.00)) && ($row_rsRecepies['rating_art'] <= 3.99)){ 
        echo "<img src="image/4point_kl.gif" width="70" height="18">"; 
    } 
    if((($row_rsRecepies['rating_art'] >= 4.00)or($row_rsRecepies['rating_art'] == 4.99)) && ($row_rsRecepies['rating_art'] <= 4.99)){ 
        echo "<img src="image/5point_kl.gif" width="70" height="18">"; 
    } 
    if($row_rsRecepies['rating_art'] == 5.0){ 
        echo "<img src="image/5point_kl.gif" width="70" height="18">"; 
    } 
} 
?>
 
това което си дал за грешка показва че грешката е на ред 106 а скрипта който си дал няма 106-ти ред
 
Дай всички кодове които ползваш защото пише че грешката е тук /users/kitchenb/public_html/proba/recepies.php в фаела recepies.php на ред 106 в това '[', expecting ')' дай целия код на фаела recepies.php и кажи скрипта какво искаш да прави?

Едит:Значи ти искаш скрипт който при всеки рефлеш да слага нова картинка ли да ги сменя? аз така като гледам тва мисля че това е целта на скрипт ама нз ти кажи?! 8)
 
Код:
<?php require_once('Connections/kitchenbg_recepies.php'); ?>
<?php
$colname_rsRecepies = "-1";
if (isset($_GET['id_art'])) {
  $colname_rsRecepies = (get_magic_quotes_gpc()) ? $_GET['id_art'] : addslashes($_GET['id_art']);
}
mysql_select_db($database_kitchenbg_recepies, $kitchenbg_recepies);
$query_rsRecepies = sprintf("SELECT * FROM kit_article_art INNER JOIN kit_topic_top ON idtop_art=id_top WHERE id_art = %s", $colname_rsRecepies);
$rsRecepies = mysql_query($query_rsRecepies, $kitchenbg_recepies) or die(mysql_error());
$row_rsRecepies = mysql_fetch_assoc($rsRecepies);
$totalRows_rsRecepies = mysql_num_rows($rsRecepies);

$colname_rsRecepies = "-1";
if (isset($_GET['id_art'])) {
$colname_rsRecepies = (get_magic_quotes_gpc()) ? $_GET['id_art'] : addslashes($_GET['id_art']);
}
mysql_select_db($database_kitchenbg_recepies, $kitchenbg_recepies);
$query_rsRecepies = sprintf("UPDATE kit_article_art SET counter_art=counter_art+1  WHERE id_art = %s", $colname_rsRecepies);
$rsRecepies = mysql_query($query_rsRecepies, $kitchenbg_recepies) or die(mysql_error());
?>
<html>
<head>

<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<META NAME="title" CONTENT="::: Десерти :::">
<META NAME="Description" CONTENT="Рецепти за ястия от Българската и Интернационалната Кухня.Практични Съвети. Енциклопедия.">
<META NAME="keywords" CONTENT="кулинария, готвене, подправки, ястия, кухня, рецепти, готварски книги, kitchen, recepies, cookingbook, spice ">
<script language=JavaScript>

</script>
<link href="file:///D|/Kitchen%20rabotno/d0001-193/weekly_menu/images/css.css" rel="stylesheet" type="text/css">
<link href="file:///D|/Kitchen%20rabotno/d0001-193/weekly_menu/images/link-css.css" rel="stylesheet" type="text/css">
<style type="text/css">

</style>

</head>

<body background="file:///D|/Kitchen%20rabotno/d0001-193/web_edd019/New%20Web/images/bg1.jpg">
<p align="center" class="style1"> </p>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"style="height: 20px;BORDER-LEFT: #669900 solid 1px;BORDER-RIGHT: #669900 solid 1px;BORDER-TOP: #669900 solid 1px;BORDER-BOTTOM: #669900 solid 1px">
  
  <tr>
    <td height="14">
      <div align="center" style="height: 20px;BORDER-BOTTOM: #669900 solid 1px">
        <p class="boxtitle"><?php function tut_stars($row_rsRecepies['rating_art'];){ 
    if((($row_rsRecepies['rating_art'] >= 0)or($row_rsRecepies['rating_art'] == 1)) && ($row_rsRecepies['rating_art'] <= 0.99)){ 
        echo "<img src="image/1point_kl.gif" width="10" height="10">"; 
    }  
    if((($row_rsRecepies['rating_art'] >= 1.00)or($row_rsRecepies['rating_art'] == 2.00)) && ($row_rsRecepies['rating_art'] <= 1.99)){ 
        echo "<img src="image/2point_kl.gif" width="70" height="18">"; 
    } 
    if((($row_rsRecepies['rating_art'] >= 2.00)or($row_rsRecepies['rating_art'] == 3.00)) && ($row_rsRecepies['rating_art'] <= 2.99)){ 
        echo "<img src="image/3point_kl.gif" width="70" height="18">"; 
    } 
    if((($row_rsRecepies['rating_art'] >= 3.00)or($row_rsRecepies['rating_art'] == 4.00)) && ($row_rsRecepies['rating_art'] <= 3.99)){ 
        echo "<img src="image/4point_kl.gif" width="70" height="18">"; 
    } 
    if((($row_rsRecepies['rating_art'] >= 4.00)or($row_rsRecepies['rating_art'] == 4.99)) && ($row_rsRecepies['rating_art'] <= 4.99)){ 
        echo "<img src="image/5point_kl.gif" width="70" height="18">"; 
    } 
    if($row_rsRecepies['rating_art'] == 5.0){ 
        echo "<img src="image/5point_kl.gif" width="70" height="18">"; 
    } 
} 
?><?php echo $row_rsRecepies['rating_art']; ?></p>
        <p class="boxtitle">:::<strong> <?php echo $row_rsRecepies['title_art']; ?> </strong>:::</p>
      </div></td>
  </tr>
  <tr>
    <td height="14" valign="top">
    <p align="left"><img src="file:///D|/Kitchen%20rabotno/d0001-193/web_edd019/New%20Web/images/square.gif" width="6" height="6"> <strong>Продукти</strong>: <?php echo $row_rsRecepies['products_art']; ?></p>    </td>
  </tr>
  <tr>
    <td height="14" valign="top"><div align="left"><img src="file:///D|/Kitchen%20rabotno/d0001-193/web_edd019/New%20Web/images/square.gif" width="6" height="6"><strong> Начин на приготвяне</strong>:<?php echo $row_rsRecepies['burn_art']; ?> </div>      <div align="justify"></div></td>
  </tr>
  <tr>
    <td height="18" valign="top"><div align="right"><a href="javascript:printWindow()"><img src="file:///D|/Kitchen%20rabotno/d0001-193/web_edd019/New%20Web/images/print2.gif" alt="Отпечатай" width="24" height="24" border="0">Принт</a></div></td>
  </tr>
  <tr>
    <td height="18" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>Гласували: <?php echo $row_rsRecepies['num_votes_art']; ?></td>
        <td><div align="right">Разгледана: <?php echo $row_rsRecepies['counter_art']; ?></div></td>
      </tr>
      <tr>
        <td><?php

//form is in php because of the variable $dl_id which is recieved through urlencode!
echo ("
<form name='Rate_Form' method='post' action='rateprocess.php'>
<select size='1' name='rating'>
<option selected value='5'>5- Excellent</option>
<option value='4'>4 - Good</option>
<option value='3'>3- Fair</option>
<option value='2'>2 - So So</option>
<option value='1'>1 - Poor</option>
<option value='0'>0- Awful</option>
</select>
<input type='hidden' name='id_art' value='$id_art'>
<input type='submit' value='Гласувай'>
</form>
");
?></td>
        <td><div align="right"></div></td>
      </tr>
      <tr>
        <td colspan="2"><div align="right">Публикувана: <?php echo $row_rsRecepies['date_art']; ?></div></td>
        </tr>
    </table></td>
  </tr>
</table>

<p align="center">.:: Copyright 2003-2006 Different World ::.</p>
</body>
</html>
<?php
//mysql_free_result($rsRecepies);
?>
 
целта ми е да проверява стойноста на рейтинга и после да показва дадена картинка. както е при торентите
 
kitchenbg каза:
целта ми е да проверява стойноста на рейтинга и после да показва дадена картинка. както е при торентите

това нещо може да го направиш с case
 
kitchenbg каза:
а нещо като пример?че си нямам ни най малка представа :? :oops:

Код:
<?php
$chislo = "1";
switch ($chislo) {
case 0:  echo "promenlivata e ravna na 0";
break;
case 1: echo "promenlivata e ravna na 1";
break;
case 2: echo "promenlivata e ravna na 2";
break;
}
?>
 

Горе