Проблем с кода за добавяне на текстове

topchokt

Registered
Здравейте имам проблем когато се опитам да добавя текст ми дава "Грешка при добавянето" Ето и кода на цялата страница:
Код:
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>www.hiphop-bg.com - Българският ХипХоп портал </title>
<meta http-equiv='Content-Type' content='text/html; charset=Windows-1251' />
<LINK REL="SHORTCUT ICON" HREF="favicon.ico">
<meta name="verify-v1" content="btHieIGe76y6ihmRE4eWZ6ZS4BxOrqGoQpk3hit766s=" />
<meta name='description' content='Безплатна музика, текстове на песни, музикални и видео клипове, новини, албуми, биографии, дискографии и още! Най-новите хитове и песни само тук. Безплатно сваляне на всичко!'>
<meta name='keywords' content=''>
<meta name="author" content="All Users" />
<meta name="distribution" content="global" />
<meta name="googlebot" content="index, follow, all" />
<meta name="language" content="bulgarian" />
<meta name="rating" content="general" />
<meta name="robots" content="index, follow" />

<meta name="owner" content="Станислав Филавтев ,Stanislav Filavtev" /> 
<link rel='stylesheet' href='new/style.css' type='text/css' />
<link rel='stylesheet' href='styles.css' type='text/css' />
<script language="JavaScript" src="../overlib.js"></script>
<script type="text/javascript" language="javascript" src="../rate/js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="../rate/js/rating.js"></script>
<link rel="stylesheet" type="text/css" href="../rate/css/rating.css" />
<style type="text/css">

</style>
</head>
<br>
<body bgcolor='#000' text='#000000'>

<table margin='0' class='bodyline' width='850' cellspacing='0' cellpadding='0' border='0' align='center'>

<tr><td align='center' valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='4'>

<tr><td width='100%' height='100%'><center><a href='index.php'><img src='new/images/head.jpg' width="850" height="145" ></a>

</center></td></tr></table>

<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td valign='top'>

<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>

<td class='menu' style='padding-left:8px; padding-top: 2px; text-align: center;' width='90%'>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='index.php' class='nav'><span style='color:white'>Начало</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='forum' class='nav'><span style='color:white'>Форум</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='song.php' class='nav'><span style='color:white'>Музика</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='lyrics.php?action=search' class='nav'><span style='color:white'>Текстове</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='albums.php' class='nav'><span style='color:white'>Албуми</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='news.php' class='nav'><span style='color:white'>Новини</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='banners.php' class='nav'><span style='color:white'>Банери</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='hiphoptv.php' class='nav'><span style='color:white'>HIPHOP TV</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='contact.php' class='nav'><span style='color:white'>Контакти</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'></td>

</tr></table>
</td></tr></table>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'></tr></table>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr valign='top'><td valign='middle' align='right' class="left">

 <b><font size=2><center></u></font></i>

<table width='100%' cellpadding='4' bgcolor='#FFFFFF' cellspacing='0' border='0'>
<td width='160' valign='top' class='left'>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'>
<tr><td class='panel' width='100%'>Потребителско Меню</td></tr><tr><td class='side-body' width='100%'><hr>

<div align='left'>
<center>
<a href="addsong.php"><img src="bull.gif" alt="Добави песен"/> Добави песен</a>
<br><a href="lyrics.php?action=add"><img src="bull.gif" alt="Добави текст"/> Добави текст</a></br>
  <?php
    if ($user->data['user_id'] == ANONYMOUS)
        {
        echo"
        <form action=\"". append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login', true, $user->session_id) . "\" method=\"post\">
        <input type=\"hidden\" name=\"mode\" value=\"login\" />
        Име:<input type=\"text\"  name=\"username\" />
        Парола:<input type=\"password\" name=\"password\" />
        Скрит <input type=\"checkbox\" class=\"radio\" name=\"viewonline\" />
        <input type=\"hidden\" name=\"autologin\" value=\"1\" />
        <input type=\"submit\" value=\"Влез\" name=\"login\" />
        <input type=\"hidden\" name=\"redirect\" value=\"index.$phpEx\" />
        </form>
        <br />
       <a href=\"forum/ucp.$phpEx?mode=register\">Регистрирай се</a>
        ";
        }
        else
        {
        echo"
        <form action=\"". append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id) . "\" method=\"post\">
        <input type=\"hidden\" name=\"mode\" value=\"logout\" />
        Изход: <input type=\"submit\" value=\"Излез\" name=\"logout\" />
        </form>
        ";
        }
?>
</center>
</div>
</td></tr></table> 

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'>
<tr><td class='panel' width='100%'>Статистика</td></tr><tr><td class='side-body' width='100%'>


</td></tr></table></div>

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'>

<i><b><span class="style1">
<?php include"config.php";
$con=mysql_connect("localhost","******","*****")or die(mysql_error());
mysql_select_db("******",$con)or die(mysql_error());
$chars="set character set cp1251";mysql_query($chars);

$sql="select * from `phpbb_users` order by user_id desc limit 1"or die(mysql_error());
$result=mysql_query($sql)or die(mysql_error());
while($r=mysql_fetch_array($result)){ $last_user=$r['username']; }

$zaqvka1=mysql_query("select count(topic_id) as total_topics from `phpbb_topics`");
while($rw=mysql_fetch_array($zaqvka1)){ $total_topics=$rw['total_topics']; }
$zaqvka2=mysql_query("select count(post_id) as total_posts from `phpbb_posts`");
while($rw=mysql_fetch_array($zaqvka2)){ $total_posts=$rw['total_posts']; }
$zaqvka3=mysql_query("select count(user_id) as total_users from `phpbb_users` where username!='anonymous'");
while($rw=mysql_fetch_array($zaqvka3)){ $total_users=$rw['total_users']; }
$zaqvka7=mysql_query("select count(ban_id) as total_banned from `phpbb_banlist`");
while($rw=mysql_fetch_array($zaqvka7)){ $total_banned=$rw['total_banned']; }

echo"
Общо мнения: <b>$total_posts</b><br>
Общо теми: <b>$total_topics</b><br>
</td></tr></table>"; ?>
</span>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr>
  <td width='100%' class='panel style11'>Реклама</td>

</tr>

<tr>

  <td width='100%' class='side-body style10'>

  <center />

 <a href="http://cs-bg.info" target="_blank" title="Counter-Strike - статии, модове, пачове, сървъри, карти и други неща за CS!"><img src="http://csbg.hit.bg/120x240.jpg" alt="CS-bg :: Български Counter-Strike фенсайт!" border="0" /></a> 

  <br/></td></tr></table>

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8' class="style10"></td></tr></table>

<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr><td width='100%' class='panel style11'>Приятели</td>

</tr>

<tr><td width='100%' class='side-body style10'>

<center>

  <a href="http://sharebg.net/">ShareBG Torrents</a>

  <br />

  <a href="http://kefche.uk.tt">Милионерите</a>

  <br />

  <a href="http://web-tourist.net/">Web-Tourist</a>

  <br />

  <a href="http://bg-best.info/">Безплатни домейни</a>

  <hr>

  
<script  type="text/javascript">

</script>
<noscript><a href="http://www.tyxo.bg/?63708" title="Tyxo.bg counter" target="_blank"><img src="http://cnt.tyxo.bg/63708" width="80" height="15" border="0" alt="Tyxo.bg counter" /></a></noscript>

</center>
<center>

</center>
</td></tr></table><table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8' class="style10"></td></tr></table>
<td valign='top' class='main-bg'>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr>
  <td class='panel' width='100%'>Спорсор</td>
</tr>
<tr><td class='side-body' width='100%'><center><a href="http://napadatel.com/" target"_top"><img src="http://www.napadatel.com/468_60.jpg" width="468" height="60" alt="" border="0"></a>

</center></td></tr></table>
<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr><td class='panel' width='100%'><b>Текстове</b></td>
</tr>

<tr>
  <td class='side-body' width='100%'>
    <div align="center">
      
      
      <span class="style12">

      </a></span>

    </div></td></tr></table>

<meta http-equiv="content-type" content="text/html; charset=windows-1251">
<span class="style12">Временно неработи
<?php
include ("config.php");
$action = htmlspecialchars(addslashes($_GET['action']));

if ( $action == "add" ) {

$add = $_POST['add'];

  if ( $add == NULL ) {

?>
<form action="lyrics.php?action=add" method="post">
<input type="text" name="artist" value="Изпълнител на песента" style="width: 400px;"><br>
<input type="text" name="song" value="Име на песена" style="width: 400px;"><br>
<textarea name="lyric" style="width: 400px; height: 400px;">
Текст на песента
</textarea><br>
<input type="submit" value="Запиши" name="add">
</form>

<?php
  }
  else {
  $artist = $_POST['artist'];
  $song = $_POST['song'];
  $lyric = $_POST['lyric'];
      if (!get_magic_quotes_gpc()) {
      $artist = addslashes(mysql_real_escape_string($artist));
      $song = addslashes(mysql_real_escape_string($song));
      $lyric = addslashes(mysql_real_escape_string($lyric));
      }
      $artist = htmlspecialchars($artist);
      $song = htmlspecialchars($song);
      $lyric = htmlspecialchars($lyric);
      $lyric = str_replace("\n", "<br>", $lyric);
  
  mysql_connect ($dbhost, $dbusername, $dbuserpass) or die('Няма връзка с mySQL!');
    mysql_select_db($db) or die('Няма връзка с базата данни!');

    $query1="INSERT INTO pesni ( id, artist, song, lyric ) VALUES ( '', '$artist', '$song', '$lyric' )";
    mysql_query($query1) or die('Грешка при добавянето!');

    echo "Песента е добавена успешно! ";   
      
  }
}
else if ( $action == "search" ) {
  $s1 = $_POST['s1'];
  
  if ( $s1 == NULL ) {
?>
<form action="lyrics.php?action=search" method="post">
<input type="text" name="search" value="" style="width: 400px;">
<input type="submit" value="Търси" name="s1">
</form>
<?php  
  }
  else {
    $search = $_POST['search'];
      if (!get_magic_quotes_gpc()) {
      $search = addslashes(mysql_real_escape_string($search));
      }
      $search = htmlspecialchars($search);
  
  $searchResults = mysql_query("SELECT * FROM pesni WHERE artist LIKE '%$search%' OR song LIKE '%$search%' OR lyric LIKE '%$search%'");

  while($row = mysql_fetch_array($searchResults)){
  echo "<a href='view.php?id=".$row['id']."'>".$row['artist']."-".$row['song']."</a><br>";
  
   }

  }

}
else {
?>
<center><a href="lyrics.php?action=add"><font size=2>Добави текст</font></a><br>
<a href="lyrics.php?action=search"><font size=2>Търси текстове</font></a><br>
<?php
}
?>
<br>
<b><font color=red>......................................</b></font></center>

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table></td>
<td width='160' valign='top' class='side-border-right'>

<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'>
<tr><td class='panel' width='100%'>Препоръчваме ви ....</td></tr>
<tr><td class='side-body' width='100%'>

<table cellpadding="0" cellspacing="0" width="100px" >
<a href="http://www.mic-beatz.com/listen.html" target"_top"><img src="http://www.hiphoprule.com/images/micbeatz.jpg" width="100" height="120" alt="" border="0"></a>
</table>
</form> </center>
</td></tr></table>

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'>
</td></tr></table>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr><td class='panel' width='100%'>Реклама</td></tr>
<tr><td class='side-body' width='100%'>
 
<script language="javascript" src="http://www.reklamnamreja.com/bnr_show.php?id=63407&s=15&c=0|"></script>

<br> </a></td></tr></table><table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr>
  <td class='panel' width='100%'>Календар</td>

</tr>

<tr><td class='side-body' width='100%'>

<center>

 <style type="text/css">
table { cursor:default; font-family:Verdana, Arial; font-size:11px; color:#5f5f5f; }
a { text-decoration:none; }
a:link { color:#003F9F; }
a:visited { color:#003F9F; }
a:hover { color:#2B2D3B; }
a:active { color:#003F9F; }
</style>

<?php
if (!$_GET["calmonth"]) {
$calturnmnth = date("n");
$nxtmnthstr = $_SERVER["QUERY_STRING"];}
else {
$calturnmnth = $_GET["calmonth"];
$nxtmnthstr = preg_replace("/(&)?calmonth=\d+/","",$_SERVER["QUERY_STRING"]);}
?>

<table width="140" align="center" cellspacing="0" cellpadding="0" bgcolor="#ffffff" style="border:1pt solid #CCCCCC; border-bottom:2pt solid #CCCCCC;">
<tr>
<td align="center" colspan="0">Календар <small>(<?php echo date ("d/n/y"); ?>)</small></td>
</tr>
<tr>
<td>
<table width="90%" align="center"><tr colspan="7">
<td colspan="7" align="center">
<?php
if (($calturnmnth-1)!="0") {
echo "<a href=\"index.php?".$nxtmnthstr."&calmonth=".($calturnmnth-1)."\"><b>««</b></a> ";}
?><b><?php echo $calturnmnth."/".date("y"); ?></b><?php
if (($calturnmnth+1)!="13") {
echo " <a href=\"index.php?".$nxtmnthstr."&calmonth=".($calturnmnth+1)."\"><b>»»</b></a>";}
?>
</td>
</tr>
<tr colspan="7" style="background:#DDDDDD;">
<td width="15%" align="center"><b>П</b></td>
<td width="15%" align="center"><b>В</b></td>
<td width="15%" align="center"><b>С</b></td>
<td width="15%" align="center"><b>Ч</b></td>
<td width="15%" align="center"><b>П</b></td>
<td width="15%" align="center"><b>С</b></td>
<td width="15%" align="center"><b>Н</b></td>
</tr>
<tr colspan="7">
<?php
$caldate = $calturnmnth;
$totalday = 29;
if (preg_match("/^(1|3|5|7|8|10|12)$/",$caldate)) {
$totalday = ($totalday+3);}
if (preg_match("/^(4|6|9|11)$/",$caldate)) {
$totalday = ($totalday+2);}
if (date("L") && $caldate=="2") {
$totalday = ($totalday+1);}

if (preg_match("/^(2|3|11)$/",$caldate)) {
$startfactor = 1;}
if (preg_match("/^(6)$/",$caldate)) {
$startfactor = 2;}
if (preg_match("/^(9|12)$/",$caldate)) {
$startfactor = 3;}
if (preg_match("/^(4|7)$/",$caldate)) {
$startfactor = 4;}
if (preg_match("/^(1)$/",$caldate)) {
$startfactor = 5;}
if (preg_match("/^(5|10)$/",$caldate)) {
$startfactor = 6;}

$totalday = ($totalday+$startfactor);
$docalcount = 1;
$calendar = 1;
while ($docalcount < $totalday) {
echo "<td width=\"15%\" align=\"right\" style=\"background:#F1F1F1;\">";
if ($startfactor!=0) {
$startfactor--;}
else {
if (date("j")==$calendar && date("n")==$caldate) {
echo "<b>".$calendar."</b>";}
else {
echo $calendar;}
$calendar++;}
echo "</td>";
if (!preg_match("/\./",($docalcount/7))) {
echo "</tr><tr colspan=\"7\">";}
$docalcount++;}
?>
</tr>
</table>
</td>
</tr>
</table>
</center>
</td></tr></table><table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table></td>
</tr>
</table>
<div class='footer_div'>
  <div align="center">© 2009 - Всички права запазени!!!<a href=''><b></b></a><b></b> </div>
</div>
</body>
</html>
 
Код:
 <?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>www.hiphop-bg.com - Българският ХипХоп портал </title>
<meta http-equiv='Content-Type' content='text/html; charset=Windows-1251' />
<LINK REL="SHORTCUT ICON" HREF="favicon.ico">
<meta name="verify-v1" content="btHieIGe76y6ihmRE4eWZ6ZS4BxOrqGoQpk3hit766s=" />
<meta name='description' content='Безплатна музика, текстове на песни, музикални и видео клипове, новини, албуми, биографии, дискографии и още! Най-новите хитове и песни само тук. Безплатно сваляне на всичко!'>
<meta name='keywords' content=''>
<meta name="author" content="All Users" />
<meta name="distribution" content="global" />
<meta name="googlebot" content="index, follow, all" />
<meta name="language" content="bulgarian" />
<meta name="rating" content="general" />
<meta name="robots" content="index, follow" />

<meta name="owner" content="Станислав Филавтев ,Stanislav Filavtev" />
<link rel='stylesheet' href='new/style.css' type='text/css' />
<link rel='stylesheet' href='styles.css' type='text/css' />
<script language="JavaScript" src="../overlib.js"></script>
<script type="text/javascript" language="javascript" src="../rate/js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="../rate/js/rating.js"></script>
<link rel="stylesheet" type="text/css" href="../rate/css/rating.css" />
<style type="text/css">

</style>
</head>
<br>
<body bgcolor='#000' text='#000000'>

<table margin='0' class='bodyline' width='850' cellspacing='0' cellpadding='0' border='0' align='center'>

<tr><td align='center' valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='4'>

<tr><td width='100%' height='100%'><center><a href='index.php'><img src='new/images/head.jpg' width="850" height="145" ></a>

</center></td></tr></table>

<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td valign='top'>

<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>

<td class='menu' style='padding-left:8px; padding-top: 2px; text-align: center;' width='90%'>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='index.php' class='nav'><span style='color:white'>Начало</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='forum' class='nav'><span style='color:white'>Форум</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='song.php' class='nav'><span style='color:white'>Музика</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='lyrics.php?action=search' class='nav'><span style='color:white'>Текстове</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='albums.php' class='nav'><span style='color:white'>Албуми</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='news.php' class='nav'><span style='color:white'>Новини</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='banners.php' class='nav'><span style='color:white'>Банери</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='hiphoptv.php' class='nav'><span style='color:white'>HIPHOP TV</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'>
<a href='contact.php' class='nav'><span style='color:white'>Контакти</span></a>
<img style='vertical-align: middle;' alt='' src='new/images/divider.gif'></td>

</tr></table>
</td></tr></table>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'></tr></table>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr valign='top'><td valign='middle' align='right' class="left">

 <b><font size=2><center></u></font></i>

<table width='100%' cellpadding='4' bgcolor='#FFFFFF' cellspacing='0' border='0'>
<td width='160' valign='top' class='left'>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'>
<tr><td class='panel' width='100%'>Потребителско Меню</td></tr><tr><td class='side-body' width='100%'><hr>

<div align='left'>
<center>
<a href="addsong.php"><img src="bull.gif" alt="Добави песен"/> Добави песен</a>
<br><a href="lyrics.php?action=add"><img src="bull.gif" alt="Добави текст"/> Добави текст</a></br>
  <?php
    if ($user->data['user_id'] == ANONYMOUS)
        {
        echo"
        <form action=\"". append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login', true, $user->session_id) . "\" method=\"post\">
        <input type=\"hidden\" name=\"mode\" value=\"login\" />
        Име:<input type=\"text\"  name=\"username\" />
        Парола:<input type=\"password\" name=\"password\" />
        Скрит <input type=\"checkbox\" class=\"radio\" name=\"viewonline\" />
        <input type=\"hidden\" name=\"autologin\" value=\"1\" />
        <input type=\"submit\" value=\"Влез\" name=\"login\" />
        <input type=\"hidden\" name=\"redirect\" value=\"index.$phpEx\" />
        </form>
        <br />
       <a href=\"forum/ucp.$phpEx?mode=register\">Регистрирай се</a>
        ";
        }
        else
        {
        echo"
        <form action=\"". append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id) . "\" method=\"post\">
        <input type=\"hidden\" name=\"mode\" value=\"logout\" />
        Изход: <input type=\"submit\" value=\"Излез\" name=\"logout\" />
        </form>
        ";
        }
?>
</center>
</div>
</td></tr></table> 

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'>
<tr><td class='panel' width='100%'>Статистика</td></tr><tr><td class='side-body' width='100%'>


</td></tr></table></div>

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'>

<i><b><span class="style1">
<?php include"config.php";
$con=mysql_connect("localhost","******","*****")or die(mysql_error());
mysql_select_db("******",$con)or die(mysql_error());
$chars="set character set cp1251";mysql_query($chars);

$sql="select * from `phpbb_users` order by user_id desc limit 1"or die(mysql_error());
$result=mysql_query($sql)or die(mysql_error());
while($r=mysql_fetch_array($result)){ $last_user=$r['username']; }

$zaqvka1=mysql_query("select count(topic_id) as total_topics from `phpbb_topics`");
while($rw=mysql_fetch_array($zaqvka1)){ $total_topics=$rw['total_topics']; }
$zaqvka2=mysql_query("select count(post_id) as total_posts from `phpbb_posts`");
while($rw=mysql_fetch_array($zaqvka2)){ $total_posts=$rw['total_posts']; }
$zaqvka3=mysql_query("select count(user_id) as total_users from `phpbb_users` where username!='anonymous'");
while($rw=mysql_fetch_array($zaqvka3)){ $total_users=$rw['total_users']; }
$zaqvka7=mysql_query("select count(ban_id) as total_banned from `phpbb_banlist`");
while($rw=mysql_fetch_array($zaqvka7)){ $total_banned=$rw['total_banned']; }

echo"
Общо мнения: <b>$total_posts</b><br>
Общо теми: <b>$total_topics</b><br>
</td></tr></table>"; ?>
</span>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr>
  <td width='100%' class='panel style11'>Реклама</td>

</tr>

<tr>

  <td width='100%' class='side-body style10'>

  <center />

 <a href="http://cs-bg.info" target="_blank" title="Counter-Strike - статии, модове, пачове, сървъри, карти и други неща за CS!"><img src="http://csbg.hit.bg/120x240.jpg" alt="CS-bg :: Български Counter-Strike фенсайт!" border="0" /></a>

  <br/></td></tr></table>

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8' class="style10"></td></tr></table>

<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr><td width='100%' class='panel style11'>Приятели</td>

</tr>

<tr><td width='100%' class='side-body style10'>

<center>

  <a href="http://sharebg.net/">ShareBG Torrents</a>

  <br />

  <a href="http://kefche.uk.tt">Милионерите</a>

  <br />

  <a href="http://web-tourist.net/">Web-Tourist</a>

  <br />

  <a href="http://bg-best.info/">Безплатни домейни</a>

  <hr>

  
<script  type="text/javascript">

</script>
<noscript><a href="http://www.tyxo.bg/?63708" title="Tyxo.bg counter" target="_blank"><img src="http://cnt.tyxo.bg/63708" width="80" height="15" border="0" alt="Tyxo.bg counter" /></a></noscript>

</center>
<center>

</center>
</td></tr></table><table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8' class="style10"></td></tr></table>
<td valign='top' class='main-bg'>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr>
  <td class='panel' width='100%'>Спорсор</td>
</tr>
<tr><td class='side-body' width='100%'><center><a href="http://napadatel.com/" target"_top"><img src="http://www.napadatel.com/468_60.jpg" width="468" height="60" alt="" border="0"></a>

</center></td></tr></table>
<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr><td class='panel' width='100%'><b>Текстове</b></td>
</tr>

<tr>
  <td class='side-body' width='100%'>
    <div align="center">
     
     
      <span class="style12">

      </a></span>

    </div></td></tr></table>

<meta http-equiv="content-type" content="text/html; charset=windows-1251">
<span class="style12">Временно неработи
<?php
include ("config.php");
$action = htmlspecialchars(addslashes($_GET['action']));

if ( $action == "add" ) {

$add = $_POST['add'];

  if ( $add == NULL ) {

?>
<form action="lyrics.php?action=add" method="post">
<input type="text" name="artist" value="Изпълнител на песента" style="width: 400px;"><br>
<input type="text" name="song" value="Име на песена" style="width: 400px;"><br>
<textarea name="lyric" style="width: 400px; height: 400px;">
Текст на песента
</textarea><br>
<input type="submit" value="Запиши" name="add">
</form>

<?php
  }
  else {
  $artist = $_POST['artist'];
  $song = $_POST['song'];
  $lyric = $_POST['lyric'];
      if (!get_magic_quotes_gpc()) {
      $artist = addslashes(mysql_real_escape_string($artist));
      $song = addslashes(mysql_real_escape_string($song));
      $lyric = addslashes(mysql_real_escape_string($lyric));
      }
      $artist = htmlspecialchars($artist);
      $song = htmlspecialchars($song);
      $lyric = htmlspecialchars($lyric);
      $lyric = str_replace("\n", "<br>", $lyric);
 
  mysql_connect ($dbhost, $dbusername, $dbuserpass) or die('Няма връзка с mySQL!');
    mysql_select_db($db) or die('Няма връзка с базата данни!');

    $query1="INSERT INTO `pesni` ( `id` , `artist` , `song` , `lyric` ) VALUES ( 'NULL', '$artist', '$song', '$lyric' )";
    mysql_query($query1) or die('Грешка при добавянето!');

    echo "Песента е добавена успешно! ";   
     
  }
}
else if ( $action == "search" ) {
  $s1 = $_POST['s1'];
 
  if ( $s1 == NULL ) {
?>
<form action="lyrics.php?action=search" method="post">
<input type="text" name="search" value="" style="width: 400px;">
<input type="submit" value="Търси" name="s1">
</form>
<?php 
  }
  else {
    $search = $_POST['search'];
      if (!get_magic_quotes_gpc()) {
      $search = addslashes(mysql_real_escape_string($search));
      }
      $search = htmlspecialchars($search);
 
  $searchResults = mysql_query("SELECT * FROM pesni WHERE artist LIKE '%$search%' OR song LIKE '%$search%' OR lyric LIKE '%$search%'");

  while($row = mysql_fetch_array($searchResults)){
  echo "<a href='view.php?id=".$row['id']."'>".$row['artist']."-".$row['song']."</a><br>";
 
   }

  }

}
else {
?>
<center><a href="lyrics.php?action=add"><font size=2>Добави текст</font></a><br>
<a href="lyrics.php?action=search"><font size=2>Търси текстове</font></a><br>
<?php
}
?>
<br>
<b><font color=red>......................................</b></font></center>

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table></td>
<td width='160' valign='top' class='side-border-right'>

<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'>
<tr><td class='panel' width='100%'>Препоръчваме ви ....</td></tr>
<tr><td class='side-body' width='100%'>

<table cellpadding="0" cellspacing="0" width="100px" >
<a href="http://www.mic-beatz.com/listen.html" target"_top"><img src="http://www.hiphoprule.com/images/micbeatz.jpg" width="100" height="120" alt="" border="0"></a>
</table>
</form> </center>
</td></tr></table>

<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'>
</td></tr></table>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr><td class='panel' width='100%'>Реклама</td></tr>
<tr><td class='side-body' width='100%'>
 
<script language="javascript" src="http://www.reklamnamreja.com/bnr_show.php?id=63407&s=15&c=0|"></script>

<br> </a></td></tr></table><table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table border='0' class='forumline' cellspacing='0' width='100%' cellpadding='3'><tr>
  <td class='panel' width='100%'>Календар</td>

</tr>

<tr><td class='side-body' width='100%'>

<center>

 <style type="text/css">
table { cursor:default; font-family:Verdana, Arial; font-size:11px; color:#5f5f5f; }
a { text-decoration:none; }
a:link { color:#003F9F; }
a:visited { color:#003F9F; }
a:hover { color:#2B2D3B; }
a:active { color:#003F9F; }
</style>

<?php
if (!$_GET["calmonth"]) {
$calturnmnth = date("n");
$nxtmnthstr = $_SERVER["QUERY_STRING"];}
else {
$calturnmnth = $_GET["calmonth"];
$nxtmnthstr = preg_replace("/(&)?calmonth=\d+/","",$_SERVER["QUERY_STRING"]);}
?>

<table width="140" align="center" cellspacing="0" cellpadding="0" bgcolor="#ffffff" style="border:1pt solid #CCCCCC; border-bottom:2pt solid #CCCCCC;">
<tr>
<td align="center" colspan="0">Календар <small>(<?php echo date ("d/n/y"); ?>)</small></td>
</tr>
<tr>
<td>
<table width="90%" align="center"><tr colspan="7">
<td colspan="7" align="center">
<?php
if (($calturnmnth-1)!="0") {
echo "<a href=\"index.php?".$nxtmnthstr."&calmonth=".($calturnmnth-1)."\"><b>««</b></a> ";}
?><b><?php echo $calturnmnth."/".date("y"); ?></b><?php
if (($calturnmnth+1)!="13") {
echo " <a href=\"index.php?".$nxtmnthstr."&calmonth=".($calturnmnth+1)."\"><b>»»</b></a>";}
?>
</td>
</tr>
<tr colspan="7" style="background:#DDDDDD;">
<td width="15%" align="center"><b>П</b></td>
<td width="15%" align="center"><b>В</b></td>
<td width="15%" align="center"><b>С</b></td>
<td width="15%" align="center"><b>Ч</b></td>
<td width="15%" align="center"><b>П</b></td>
<td width="15%" align="center"><b>С</b></td>
<td width="15%" align="center"><b>Н</b></td>
</tr>
<tr colspan="7">
<?php
$caldate = $calturnmnth;
$totalday = 29;
if (preg_match("/^(1|3|5|7|8|10|12)$/",$caldate)) {
$totalday = ($totalday+3);}
if (preg_match("/^(4|6|9|11)$/",$caldate)) {
$totalday = ($totalday+2);}
if (date("L") && $caldate=="2") {
$totalday = ($totalday+1);}

if (preg_match("/^(2|3|11)$/",$caldate)) {
$startfactor = 1;}
if (preg_match("/^(6)$/",$caldate)) {
$startfactor = 2;}
if (preg_match("/^(9|12)$/",$caldate)) {
$startfactor = 3;}
if (preg_match("/^(4|7)$/",$caldate)) {
$startfactor = 4;}
if (preg_match("/^(1)$/",$caldate)) {
$startfactor = 5;}
if (preg_match("/^(5|10)$/",$caldate)) {
$startfactor = 6;}

$totalday = ($totalday+$startfactor);
$docalcount = 1;
$calendar = 1;
while ($docalcount < $totalday) {
echo "<td width=\"15%\" align=\"right\" style=\"background:#F1F1F1;\">";
if ($startfactor!=0) {
$startfactor--;}
else {
if (date("j")==$calendar && date("n")==$caldate) {
echo "<b>".$calendar."</b>";}
else {
echo $calendar;}
$calendar++;}
echo "</td>";
if (!preg_match("/\./",($docalcount/7))) {
echo "</tr><tr colspan=\"7\">";}
$docalcount++;}
?>
</tr>
</table>
</td>
</tr>
</table>
</center>
</td></tr></table><table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table>
<table width='100%' cellspacing='0' cellpadding='0'><tr><td height='8'></td></tr></table></td>
</tr>
</table>
<div class='footer_div'>
  <div align="center">© 2009 - Всички права запазени!!!<a href=''><b></b></a><b></b> </div>
</div>
</body>
</html>
 

Горе