Просмотр файла send.php

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

require_once"../template/start.php";

require_once"../template/regglobals.php";

require_once"../template/config.php";

require_once"../template/functions.php";

require_once"../template/maincore.php";

require_once"../template/antidos.php";

require_once"../template/cookies.php";

require_once"../template/gzip.php";

require_once"../template/header.php";

require_once"../template/referer.php";

include_once"../themes/$config_themes/index.php";



$UIN = '***'; //icq-номер

$PASSWORD = '***'; //пароль





if ($provlog==$_SESSION['log'] && $provpar==md5($_SESSION['par']) && $_SESSION['log']!="" && md5($_SESSION['par'])!="") {





$uin=check($uin); 



if(!empty($uin) && !eregi("[^0-9-]",$uin)){



$uin = str_replace('-','',$uin);





if(!isset($uin) or !isset($_POST['text']))

{

 if(isset($uin)){echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

 <title>ICQ | SmartOff.Net</title>

</head>

<body>

<b>Отправка ICQ-сообщения: '.$uin.'</b><br/>

<form method="post" action="send.php"><br>

<input name="uin" type="hidden"  value="'.$uin.'" maxlength="9">

<br>

Сообщение:<br>

<input type="Text" name="text" value="" maxlength="500"><br>

<input name="pod" type="hidden"  value="(http://smartoff.net)  Сообщение от '.$log.':          " maxlength="100"><br>

<input type=submit name="send" value="Отправить">

</form><br>



<a href="../index.php">На главную</a><br/>';

	}else{

		echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

 <title>ICQ | SmartOff.Net</title>

</head>

<body>

<b>Отправка ICQ-сообщений</b><br/>

<form method="post" action="send.php">

Номер ICQ:<br>

<input type="Text" name="uin" value="" maxlength="9"><br>

Сообщение:<br>

<input type="Text" name="text" value="" maxlength="500"><br>

<input type=submit name="send" value="Отправить">

</form><br>

<a href="../index.php">На главную</a><br>';

}}else{



	include('WebIcqLite.class.php');



 $text=Encode($_POST['text'],'w');

$pod=Encode($_POST['pod'],'w');



    $icq = new WebIcqLite();

    if($icq->connect($UIN, $PASSWORD)){

        if(!$icq->send_message($_POST['uin'],  $pod.''.$text)){

            echo $icq->error;

        }else{

            echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

	<title>ICQ | SmartOff.Net</title>

</head>

<body>

<b>Отправка ICQ-сообщений</b><br/>

Сообщение отправлено.<br>

<a href="index.php">Отправить еще</a><br> <a href="../index.php">На главную</a>';

        }

        $icq->disconnect();

    }else{

        echo $icq->error;

    }

} 





}else{echo' <br>Уин неверный или пустой! Перейдите на <a href="../index.php?'.SID.'">На главную</a><br>';}  

}else{echo' <br>Вы не авторизированны!  Перейдите на <a href="../index.php?'.SID.'">На главную</a><br>';}  



function Encode($str,$type=u)

{

	$conv=array();

	for($x=192;$x<=239;$x++)

  $conv['u'][chr($x)]=chr(208).chr($x-48);

	for($x=240;$x<=255;$x++)

  $conv['u'][chr($x)]=chr(209).chr($x-112);

 $conv['u'][chr(168)]=chr(208).chr(129);

 $conv['u'][chr(184)]=chr(209).chr(209);

 $conv['w']=array_flip($conv['u']);

	if($type=='w' || $type=='u')

		return strtr($str,$conv[$type]);

	else

		return $str;

}



include_once"../themes/$config_themes/foot.php";

?>