<?php
if (isset($_GET["q"]) && !empty($_GET["q"]))
{
if (file_exists("embedded/functions/site_functions.php"))
	{
	include_once("embedded/functions/site_functions.php");
	}
else
	{
include_once("../../embedded/functions/site_functions.php");
	}
$language=$_SESSION['language'];
db_open();
if ($language==1)
	{
	$head1="Σφάλμα δεδομένων!";
	$head2="Δεκτό!";
	$pattern="/[^!.,_A-Za-zάΆέΈήΉίΊόΌύΎώΏΖζΧχΨψωΩβΒνΝμΜΛλΚκΞξΗηΓγΦφΔδΣσΑαςΕεΡρΤτΥυΘθΙιΟοπΠ0-9\' ']/";
	}
else
	{
	$head1="Invalid data!";
	$head2="Done!";
	$pattern="/[^!.,_A-Za-z0-9\' ']/";
	}
$q= strip_tags(htmlspecialchars(mysql_real_escape_string(trim($_GET["q"]))));
	if (preg_match($pattern, $q))
	{
	echo '<span class="invalid">'.$head1.'</span>';
	}
	else
	{
	echo '<span class="valid">'.$head2.'</span>';
	}
	
db_close();	
}

?>