Лишний символ в textarea, не записывается в Mysql

Select

Новичок
Вечер добрый, у меня такая проблема возникла - создал сайт, создал страницу редактирования для администраторов...

Все страницы редактируются, но вот 1 зараза не хочет, она большая - я как то взял вырезал полстраницы и получилось сохранить)) но вот все остальное как будто выплевывает...


Вот код если что обработчика .. сильно не пинайте..

PHP:
<?php
require "auth.php"; 
require "blocks/bd.php";


if (isset($_POST['title']))       
{
$title = $_POST['title']; 

if ($title == '') 
{
unset($title);
}  

}

/* Если существует в глобальном массиве $_POST['title'] опр. ячейка, то мы создаем простую переменную из неё. Если переменная пустая, то уничтожаем переменную.   */
if (isset($_POST['text']))        {$text = $_POST['text']; if ($text == '') {unset($text);}}
if (isset($_POST['id']))    	  {$id = $_POST['id'];}
if (isset($_POST['page']) && $_POST['page']=="profiles")      {$profile = 1;}



$result = mysql_query("SELECT * FROM teachers WHERE login='$_COOKIE[login]' ");      
$myrow = mysql_fetch_array($result);

 // Проверяем кто зашел на сайт
if($myrow["group"]==2) { $admin=1; 
	if (isset($_POST['icons']))           {$icons = $_POST['icons']; }
	if (isset($_POST['short_text']))      {$short_text = $_POST['short_text'];}
 }   

?>

<?php 

if (isset($_GET['id'])) {$id = $_GET['id'];}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title></title>
<link href="style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/jquery.noty.css"/>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.noty.js"></script>
<?

if (isset($text))
{

if ($profile == 1) {
if($admin!=1){
    $result = mysql_query ("UPDATE `profiles` SET text='$text' WHERE id='$id' ");
		
$to  = "[email protected], " ; 
$to .= "[email protected]"; 

$result = mysql_query("SELECT * FROM profiles WHERE id=$id");      
$myrow = mysql_fetch_array($result);

$subject = "Внесены правки в личную страницу: ".$myrow[title]; 
$subject = '=?koi8-r?B?'.base64_encode(convert_cyr_string($subject, "w","k")).'?='; 

$message = ' <br>
Были внесены изменения в личную страницу: <a href="http://school528.spb.ru/main/profile.php?id='.$id.'">'.$myrow[title].'</a><br><br><br>
Было изменено пользователем:'.$_COOKIE[login].' <br><br>
Время изменения: '.date( " d.m.y H:i").'<br><br><br>

По всем вопросам обращайтесь по почте [email protected]  <br><br>
IP:'.$_SERVER["REMOTE_ADDR"].'
Браузер'.$_SERVER["HTTP_USER_AGENT"].' '; 

$headers  = "Content-type: text/html; charset=windows-1251 \r\n"; 
$headers .= "From: School528 \r\n"; 

mail($to, $subject, $message, $headers);
}
else{ 
		if (isset($short_text) && isset($icons))
			{
				$result = mysql_query ("UPDATE `profiles` SET text='$text',short_text='$short_text',icons='$icons' WHERE id='$id'");
			}
	}
}

else {
	
	if($admin!=1){


$result = mysql_query ("UPDATE `pages` SET text='$text' WHERE id='$id'");

$to  = "[email protected], " ; 
$to .= "[email protected]"; 

$result = mysql_query("SELECT * FROM pages WHERE id='$id'" );      
$myrow = mysql_fetch_array($result);

$subject = "Внесены правки на странице: ".$myrow[title]; 
$subject = '=?koi8-r?B?'.base64_encode(convert_cyr_string($subject, "w","k")).'?='; 

$message = ' <br>
Были внесены на странице: <a href="http://school528.spb.ru/main/index.php?id='.$id.'">'.$myrow[title].'</a><br><br>
Было изменено пользователем:'.$_COOKIE[login].'<br><br>
Время изменения: '.date( " d.m.y H:i").'<br><br><br><br>


По всем вопросам обращайтесь по почте [email protected] <br><br>
IP:'.$_SERVER["REMOTE_ADDR"].'
Браузер'.$_SERVER["HTTP_USER_AGENT"].' '; 

$headers  = "Content-type: text/html; charset=windows-1251 \r\n"; 
$headers .= "From: School528 \r\n"; 

mail($to, $subject, $message, $headers);
	}
	else{ 
		if (isset($short_text) && isset($icons))
			{
				$result = mysql_query ("UPDATE `pages` SET text='$text',short_text='$short_text',icons='$icons' WHERE id='$id'");
			}
	}
}

if ($result == 'true') {?>
<script>
var noty_id = noty({
  text: 'Материал успешно обновлен!',
  layout: 'center',
  type:'alert',
  textAlign:'center',
  speed:'100',
  timeout:'3000'

});</script> <?
}	
else {?>
   <script>

var noty_id = noty({
  text: 'Материал не обновлен!',
  layout: 'center',
  type:'alert',
  textAlign:'center',
  speed:'100',
  timeout:'3000'

});</script> <?

}	
}?>

</head>
<body>

<div id="result"> </div>
<table width="1000" style:"min-height:600px;" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="main_border">
<!--Подключаем шапку сайта-->	
<?php if(file_exists("blocks/header.php")){
			require_once "blocks/header.php";
		}?>
  <tr>
    <td><table width="900" height="600"   border="0" cellspacing="0" cellpadding="0">
      <tr>
<!--Подключаем левый блок сайта-->
<?php if(file_exists("blocks/lefttd.php")){
			require_once "blocks/lefttd.php";
		}  ?>    
        <td valign="top" style:"min-height:600px;">
<center>
Посмотреть полученную страницу можно <?
if ($profile == 1) { ?> <a href="http://school528.spb.ru/main/profile.php?id=<? echo $id; ?>" target="_blanck">здесь</a><? } 
else  {?> <a href="http://school528.spb.ru/main/index.php?id=<? echo $id; ?>" target="_blanck">здесь</a><? } ?>.
<br>
      
По всем вопросам обращайтесь по почте [email protected]   

<br><br><br>
<a href="http://school528.spb.ru/main/admin/edit_lesson.php"> НАЗАД </a>
       </center>
         </td>
      </tr>
    </table></td>
  </tr>
<!--Подключаем нижний графический элемент-->  
<?php if(file_exists("blocks/footer.php")){
			require_once "blocks/footer.php";
		}?>    
</table>

</body>
</html>
 
Сверху