<?php
////////////////////////////////////////////////
$user = fopen("user.txt", "r");
$fgets_u = fgets($user);
$text = fopen("text.txt", "r");
$fgets_t = fgets($text);
////////////////////////////////////////////////
////////////////////////////////////////////////
$url = "http://example.com/includes/ajax/message.php?opt=addpost";
$postdata = "comment_message=". htmlentities(urlencode($fgets_t)) . "+&pid=" . $fgets_u;
$referer = "http://example.com/index.php";
$user_cookie_file = fopen("cookie.txt", "w");
chmod("cookie.txt", 0777);
$cookie_file = "cookie.txt";
$ip = "192.168.12.12";
////////////////////////////////////////////////
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT,
'Internet Explorer/6.0 (X11; U; Windows XP SP2; en-US; rv:1.7.2) Gecko/20040804');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Language: ru,en;q=0.7,de-de;q=0.3',
'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
'X-Forwarded-For: ' . $ip));
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$page = curl_exec($ch);
curl_close($ch);
echo $page;
echo "<meta http-equiv=\"refresh\" content=\2; URL=http://example.ru/add_post.php\" /> ";
|