VK graffiti sender

Все видели убогий "flash-paint"? А почему бы не нарисовать"красиво" в "нормальных" графических редакторах? Или вообще найти что-нибудь готовое в сети.
kisa
И собственно сам скрипт:

<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<style>
body {
font:.8em Georgia, serif;
color:#F74600;

line-height:1.6em;
background:#363940;
}

.add_log {
	width:120px;
	height:20px;
	font-family:tahoma;
	font-size:11px;
	border:1px solid #A1B1BE;
	}
.add_but {
	width:120px;
	height:22px;
	font-family:tahoma;
	font-size:11px;
	border:1px solid #A1B1BE;
	}
	a {
color:#F74600;
text-decoration:none;
background:inherit;
}

a:hover {
color:gray;
background:inherit;
border-bottom: 1px dotted gray;
}

</style>
</head>
<body>
<form method="POST" enctype="multipart/form-data">
<table border="1" align="center">
<tr><td>ID получателя!(только цифры)</td><td><input type="text" name="userid" class="add_but"></td>
<tr><td>Ваш e-mail(от ВК)</td><td><input type="text" name="email" class="add_but"></td>
<tr><td>Ваш пароль(от ВК)</td><td><input type="password" name="password" class="add_but"></td>
<tr><td>Картинка(586*293 и PNG!)</td><td><input type="file" name="FILE" size="40" class="add_but" /></td>
<tr><td></td><td><input type="submit" name="submit" class="add_but" value="Отправить!"></td>
<tr>
<td colspan="2" align="center">
by <b>#Wolf#</b> <a href="http://wolf-et.ru/">http://wolf-et.ru/</a></td></tr>
</table>
</form>
<?
#################################
# VK graffiti sender
# by #Wolf#
# http://wolf-et.ru/
# License: gnu gpl v3
#################################
if(!isset($_POST['submit'])){exit();}

if($_FILES['FILE']['name']){
	    if($_FILES['FILE']['type'] == 'image/png') {
	if(is_uploaded_file($_FILES['FILE']['tmp_name'])) {
		if($_FILES['FILE']['size'] != 0 AND $_FILES['FILE']['size']<=204800) {
			if(move_uploaded_file($_FILES['FILE']['tmp_name'],basename($_FILES['FILE']['name']))) {
			         }else{echo 'Произошла ошибка при перемещении файла в папку';}
                     }else{echo 'Размер файла не должен превышать 200Кб';}
                     }else{echo 'Прозошла ошибка при загрузке файла на сервер';}
                     }else{echo 'Файл не является картинкой формата PNG';}
                     }else{echo 'Файл должен иметь название';}

#####################################
$email=$_POST['email'];
//if(!preg_match('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])*(\.([a-z0-9])([-a-z0-9_-])([a-z0-9])+)*$/i',$email)) {die('Не верный формат email!');}
$pass=$_POST['password'];
$id=$_POST['userid'];
$graffitiFile = basename($_FILES['FILE']['name']);
   function post($url,$post,$refer)
	{
       $ch = curl_init($url);
       curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 AdCentriaIM/1.7 Firefox/3.0.4");
       curl_setopt($ch, CURLOPT_POST, 1);
       curl_setopt($ch, CURLOPT_HEADER, 0);
       curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
       curl_setopt($ch, CURLOPT_REFERER, $refer);
       curl_setopt($ch, CURLOPT_COOKIEJAR, "./cookies.txt");
         curl_setopt($ch, CURLOPT_COOKIEFILE, "./cookies.txt");
       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       $result  = curl_exec($ch);
	   return $result;
	}
$image=Array
(
'Signature' => md5(substr(base64_encode(file_get_contents($graffitiFile)), 0,1024)),
'Filedata' => '@' . realpath($graffitiFile),
'Upload' => 'Submit Query',
);
$result = post('http://vk.com/login.php',
               'act=login&success_url=&fail_url=&try_to_login=1&to=&vk=&email='.$email.'&pass='.$pass,
			   'http://vk.com/');

		   $result2=post('http://vk.com/graffiti.php?to_id='.$id.'&group_id=0',$image,'http://vk.com/swf/Graffiti.swf?15');
echo '<h2><center><br /><a target="_blank" href="http://vk.com/graffiti.php?act=last">Теперь пройдите по этой ссылке и опубликуйте граффити!</a></center></h2>';

?>
</body>
</html>

Демо: http://wolf-et.ru/vk/g/index.php

  1. Комментов пока нет

*

 
http://wolf-et.ru/wp-admin/page/library/