Просмотр файла quote_bash/add.php

Размер файла: 1.5Kb
<?

require ( dirname ( __FILE__ ) . '/config.php' );
session_start(); 


$text = (isset($_POST['text'])) ? mysql_escape_string(trim($_POST['text'])) : ''; 
$text = substr($text,0,1000);

if($_SESSION['checkcod'] != $_POST['control'] || empty($_POST['control'] )){
$err[] = 'Не правильно введён код с картинки!';
}   
session_destroy();
if(empty($text)) $err[] = 'Вы не ввели текст!';
if (!is_utf8($text)) $err[] = 'Не допустимые символы в тексте!';

if(!empty($err))
		{				
	include_once '../header.php';	
		foreach($err as $error) 
		echo $error.'<br/>';
		echo '&#187;<a href="./index.php">Назад</a>';	
echo '</body></html>';					        
		die();
		}else{		
mysql_unbuffered_query("INSERT INTO `tmp_text` VALUES('NULL','". $text."')") or die(mysql_error());
header ( "Content-type: application/xhtml+xml; charset=utf-8" );
echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10-flat.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
<link rel="stylesheet" href="./style.css" />
<title>..::BiWap.Net::..</title>
</head><body>';			
echo '<b>Вашь текст успешно добавлен! После модерации он окажется в нашем цитатнике</b>!<br/>';
echo '&#187;<a href="./index.php">Назад</a>';	
echo '</body></html>';	
}		

?>