<?php

session_name('SESID');
session_start();


$connect1 = @ mysql_pconnect(localhost, max4, max4) or die('cannot connect to server');
@ mysql_select_db(max4) or die('cannot connect to db');
@ mysql_query("SET NAMES 'utf8'", $connect1);
$user_id = (int)$_SESSION['uid'];
$login1 = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".$user_id."'", $connect1));    
$count_newmail11 = mysql_result(mysql_query("SELECT COUNT(*) FROM `privat` WHERE `user` = '".$login1['name']."' AND `type` = 'in' AND `chit` = 'no';",$connect1), 0);


Header("Content-type: image/gif");
$img = imageCreateFromGIF('panel/Message.gif');
$color = imagecolorallocate($img,255,0,5);
ImageString($img, 5, 25, 14, '+'.$count_newmail11, $color);
ImageGIF($img);
ImageDestroy($img);
?>