Курсовая работа: Создание сайта Библиотека онлайн
$num=mysql_num_rows($query);
for($i=1; $i<=$num; $i++)
{
$arr=mysql_fetch_row($query);
$text=$text."<tr><td><font color=\"blue\">• <a href=\"books.php?book_id=".$arr[1]."\"><font color=\"blue\">".stripslashes($arr[0])."</font></a></font></td><tr>\n";
}
$text=$text."</table>\n";
}
else {
$query=mysql_query("select `num_inventory` from `Books` where `presence`='0' and `num_book`='$book_id'", $link) or die(mysql_errno($link).": ".mysql_error($link));
$presence=mysql_num_rows($query);
mysql_free_result($query);
$query=mysql_query("select * from `Book` where `num_book`='$book_id'", $link) or die(mysql_errno($link).": ".mysql_error($link));
$arr=mysql_fetch_array($query);
if(!strcmp($HTTP_COOKIE_VARS["password"], $g_adm_pass))
{
$edit_btn="<form action=\"libry_add.php\" method=\"post\">
<input name=\"action\" type=\"hidden\" value=\"Удалить книгу\">\n
<input name=\"book_id\" type=\"hidden\" value=\"".$book_id."\">\n
<input type=\"submit\" value=\"Удалить книгу\">
</form>\n
<form action=\"libry_add.php\" method=\"post\">\n
<input name=\"name_book\" type=\"hidden\" value=\"".stripslashes($arr["name_book"])."\">\n
<input name=\"author\" type=\"hidden\" value=\"".stripslashes($arr["author"])."\">\n
<input name=\"coauthor\" type=\"hidden\" value=\"".stripslashes($arr["coauthor"])."\">\n
<input name=\"place_publ\" type=\"hidden\" value=\"".stripslashes($arr["place_publ"])."\">\n
<input name=\"year_publ\" type=\"hidden\" value=\"".$arr["year_publ"]."\">\n
<input name=\"publishers\" type=\"hidden\" value=\"".stripslashes($arr["publishers"])."\">\n
<input name=\"amount_pages\" type=\"hidden\" value=\"".$arr["amount_pages"]."\">\n