<?php
session_start();
include("connect.php");
if($_POST['code'] != $_SESSION['captchacode'] OR $_SESSION["captchacode"]=='')
{
tpl_header($LANGAUGE[126]);
table($LANGAUGE[126],$LANGAUGE[178],1);
tpl_footer();
exit;
}

$names = trim($_POST['namesearch']);
$names = addslashes($names);
$namee = clean_value($names);
$text = htmlspecialchars($namee);

$msg = "";

if($text == ""){
$msg .= '<li>'.$LANGAUGE[258].'</li>';
$goo = "no";
}

if(strlen($text) <= 2){
$msg .= '<li>'.$LANGAUGE[259].'</li>';
$goo = "no";
}

if(strlen($text) >= 61){
$msg .= '<li>'.$LANGAUGE[260].'</li>';
$goo = "no";
}

if(ereg("['\"*#;]" , $text)){
$msg .= '<li>'.$LANGAUGE[256].'</li>';
$goo = "no";
}

if($goo != "no"){
setcookie("filter",time()+60,time()+3600);
$cou = intval($_COOKIE['filter']);
$ttime = time();

if($ttime < $cou){
$xxyy = $LANGAUGE[261];
}else{
$num = mysql_query("select * from search where name='".$text."'");
$refnumber = mysql_num_rows($num);

if($refnumber == 0){
$sqlr = mysql_query("insert into search SET name='".$text."', counter='1', date='".time()."'");
$idxx = mysql_insert_id();
}else{
$Roww = mysql_fetch_array($num);
$idxx = $Roww['id'];
$sqlr = mysql_query("update search set counter=counter+1, date='".time()."' where name='".$text."'");
}
$xxyy = result($text,20);
}
}else{
$xxyy = "<ul>".$msg."</ul>".$LANGAUGE[131]."";
}

tpl_header($LANGAUGE[151]);
bar($namelinks1,$LANGAUGE[151],"","");
table($LANGAUGE[151],$xxyy,1);
tpl_footer();
?>