Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_GET["rep3"])) {
- send_cap();
- }
- else
- load_page_alt('http://blogs.yandex.ru/search.xml?text='.rawurlencode('концерт'));
- function send_cap() {
- $url='http://blogs.yandex.ru/checkcaptcha?rep='.$_GET["rep3"].
- '&key='.$_GET["key3"].'&retpath='.$_GET["retpath3"];
- echo '<b>'.$url.'</b><br/>';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HEADER,1);
- //curl_setopt($ch, CURLOPT_POST,1)
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)");
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'yacook.txt');
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'yacook.txt');
- curl_setopt($ch, CURLOPT_REFERER,'http://blogs.yandex.ru/showcaptcha?retpath=http%3A//blogs.yandex.ru/search.xml%3Ftext%3D%25EA%25EE%25ED%25F6%25E5%25F0%25F2&t=0/1348956701/2a68e643f520fd91f358b6789c10e8f5&status=failed&s=86568a1fe5774c0ca9745b045091e00e');
- $result = curl_exec($ch);
- $result = mb_convert_encoding($result,'windows-1251');
- echo $result;
- }
- //-------------------------------------------------------
- function load_page_alt($url) {
- header('Content-type: text/html; charset=windows-1251');
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'yacook.txt');
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'yacook.txt');
- $result = curl_exec($ch);
- curl_close($ch);
- $ftg = mb_detect_encoding($result);
- echo 'encoding:'.$ftg.'<br/>';
- $result = mb_convert_encoding($result, 'windows-1251', $ftg);
- $zzuu = '"'.$_SERVER["PHP_SELF"].'"';
- $zzstr = <<<INF
- <script type="text/javascript">
- function submuu(f) {
- var zwin = open ( {$zzuu}+"?rep3="+encodeURIComponent(f.rep3.value)+
- "&key3="+encodeURIComponent(f.key3.value)+
- "&retpath3="+encodeURIComponent(f.retpath3.value));
- }
- function fff() {
- //alert('test');
- var fz=document.forms[1];
- var fgo = document.forms[0];
- //alert(fz);
- fgo.key3.value = fz.key.value;
- fgo.retpath3.value = fz.retpath.value;
- }
- </script>
- <form action="#" onsubmit="submuu(this);return false;" method="GET">
- <input type="TEXT" name="rep3" />
- <p> key <input type="TEXT" name="key3" /></p>
- <p> retpath <input type="TEXT" name="retpath3" /></p>
- <input type="SUBMIT" name="subm3" value="send" />
- <input type="BUTTON" onclick="fff();" value="fill" />
- </form>
- INF;
- echo $zzstr;
- //$result = mb_convert_encoding($result,'windows-1251');
- echo $result;
- //echo '<pre>'.htmlentities(print_r($result)).'</pre>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement