//
$gbook_txt="../gbook.txt";
$spam_words=array('viagra', 'cialis', 'levitra', 'bingo', 'poker', 'casino', 'slots', 'lottery', 'http:', 'blackjack', 'facking', 'sucking');
$warning='²ÝáõÝ »õ
Ø»Ïݳµ³ÝáõÃÛáõÝ
¹³ßï»ñÁ Éñ³óÝ»ÉÁ
å³ñï³¹Çñ ¿:';
// include("head.php");
function name($el)
{
if (substr($el, 0, 5)=='name:') return TRUE; else return FALSE;
}//name
function delete_message($num)
{
global $gbook_txt;
$msgs=file($gbook_txt);
for($i=0;$i<6;$i++)
unset($msgs[$num+$i]);
$fh=fopen($gbook_txt, 'w');
fclose($fh);
}//delete_message
function show_guestbook()
{
global $gbook_txt;
?>
}//show_guestbook
//-----------------------------------------------------------------------------------------------------------------------------
function new_message()
{
global $gbook_txt;
if ( $_SERVER['HTTP_REFERER'] =="http://www.azgk.am/eng/gbook.php?action=show")
{
?>
$msgs=array();
$msgs=file($gbook_txt);
$rec_start=array_filter($msgs, 'name');
$keys=array_keys($rec_start);
$msgs_count=sizeof($keys);
for($i=$msgs_count-1; $i>=0;$i--)
{
?>
Leave your message here
echo substr($msgs[$keys[$i]+1], 6); echo ' '; //date time
?>
if (trim(substr($msgs[$keys[$i]+2], 6))!='') echo ''.substr($msgs[$keys[$i]], 6).'';
else
echo substr($msgs[$keys[$i]], 6); //name
if(trim(substr($msgs[$keys[$i]+3], 4))!='') echo "
".substr($msgs[$keys[$i]+3], 4).'';
?>
echo substr($msgs[$keys[$i]+5], 5); //msg
?>
}//for
?>
$url=substr($msgs[$keys[$i]+4], 6);
if($url!='')
echo "Personal Page"; //url
else echo ' ';
?>
Please, leave your message here.
';
echo $warning.'
';
?>