Advertisement
johnburn

Untitled

Mar 23rd, 2012
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.68 KB | None | 0 0
  1. <?php
  2. function send_ping($the_host, $rok, $name, $url) {
  3.     global $_text;
  4.     $xml_data = "<?xml version=\"1.0\" ?><methodCall><methodName>weblogUpdates.ping</methodName>\t<params><param><value><string>{$name}</string></value></param><param><value><string>{$url}</string></value></param></params></methodCall>";
  5.     $the_host = str_replace("http://", "", $the_host);
  6.     $the_host = str_replace("https://", "", $the_host);
  7.     $ch = curl_init();
  8.     $headers = array("Content-Type: text/xml");
  9.     curl_setopt($ch, CURLOPT_URL, $the_host);
  10.     curl_setopt($ch, CURLOPT_HEADER, 1);
  11.     curl_setopt($ch, CURLOPT_POST, 1);
  12.     curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  13.     curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
  14.     curl_setopt($ch, CURLOPT_INFILESIZE, "250");
  15.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  16.     curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  17.     curl_setopt($ch, CURLOPT_USERAGENT, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
  18.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  19.     $xml = curl_exec($ch);
  20.     curl_close($ch);
  21.     if (eregi($rok, $xml)) {
  22.         $_u = "<div id=\"sucess\">" . $_text['02'] . "</div>";
  23.     } else {
  24.         $_u = "<div id=\"error\">" . $_text['03'] . "</div>";
  25.     }
  26.     return $_u;
  27. }
  28. include ("language.php");
  29. error_reporting(0);
  30. $data = file("@@@_engines.txt");
  31. $nb = count($data);
  32. echo "<s";
  33. echo "cript>\nfunction checkAll(field)\t{\tfor (i = 0; i < field.length; i++)\tfield[i].checked = true ;\t}function uncheckAll(field){for (i = 0; i < field.length; i++)\tfield[i].checked = false ;\t}</script>\n";
  34. if ($_POST[md5(date("YmdH", time()) . $_SERVER['REMOTE_ADDR'] . "login") ]) {
  35.     if (count($_POST['site']) == "0") {
  36.         $_merror[4] = $_text['012'];
  37.         $_error.= "1";
  38.     }
  39.     if (empty($_SESSION['img_verification'])) {
  40.         $_merror[3] = "   ";
  41.         $_error.= "1";
  42.     }
  43.     if (empty($_POST['bname'])) {
  44.         $_merror[2] = $_text['011'];
  45.         $_error.= "1";
  46.     }
  47.     if (trim($_POST['check']) != $_SESSION['img_verification']) {
  48.         $_merror[3] = "   ";
  49.         $_error.= "1";
  50.     }
  51.     if (!eregi("^(http|https)+(:\\/\\/)+[a-z0-9_-]+\\.+[a-z0-9_-]", $_POST['url'])) {
  52.         $_merror[1] = $_text['010'];
  53.         $_error.= "1";
  54.     }
  55.     if (empty($_error)) {
  56.         echo $_text['09'];
  57.         $i = 0;
  58.         while ($i <= $nb) {
  59.             if ($_POST['site'][$i]) {
  60.                 $subdata = explode("|", $data[$i]);
  61.                 echo "<strong>" . $subdata['1'] . "</strong> ";
  62.                 echo $_res = send_ping("" . $subdata['2'] . "", "" . $subdata['3'] . "", "" . strip_tags($_POST['bname']) . "", "" . $_POST['url'] . "") . "<br /><hr />";
  63.                 ob_flush();
  64.                 flush();
  65.             }
  66.             ++$i;
  67.         }
  68.         $_allok = "1";
  69.         $_SESSION['img_verification'] = "";
  70.     }
  71. }
  72. if ($_allok != "1") {
  73.     echo "<form action=\"\" method=\"post\" name=\"myform\" id=\"myform\">\n    <label>";
  74.     echo $_text['05'];
  75.     echo $_merror[2];
  76.     echo "</label> \n    <input name=\"bname\" type=\"text\" style=\"border: 1px solid #808080;color: #333333;width: 98%;\" value=\"";
  77.     strip_tags($_POST['bname']);
  78.     echo "\"  maxlength=\"100\"/>\n    <label>";
  79.     echo $_text['04'];
  80.     echo $_merror[1];
  81.     echo "</label> \n    <input name=\"url\" type=\"text\" style=\"border: 1px solid #808080;color: #333333;width: 98%;\" size=\"50\" value=\"";
  82.     echo ($url = $_POST['url']) ? $url : "http://";
  83.     echo "\" maxlength=\"150\" /> \n<br />\n     <div align=\"center\"><input name=\"";
  84.     echo md5(date("YmdH", time()) . $_SERVER['REMOTE_ADDR'] . "login");
  85.     echo "\" type=\"submit\" value=\"";
  86.     echo $_text['08'];
  87.     echo "\" /></div>\n<br />\n    <p><a href=\"#\" onclick=\"checkAll(document.myform.list)\">";
  88.     echo $_text['06'];
  89.     echo "</a>\n\t<a href=\"#\" onclick=\"uncheckAll(document.myform.list)\">";
  90.     echo $_text['07'];
  91.     echo "</a><br />\n";
  92.     $num_chars = 6;
  93.     $chrs = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");
  94.     unset($_SESSION['img_verification']);
  95.     if (!isset($_SESSION['img_verification'])) {
  96.         $string = "";
  97.         $n = 0;
  98.         while ($n < $num_chars) {
  99.             $string.= $chrs[rand(0, 36) ];
  100.             ++$n;
  101.         }
  102.     }
  103.     $_SESSION['img_verification'] = $string;
  104.     echo "\n<input type=\"hidden\" name=\"check\" value=\"";
  105.     echo $_SESSION['img_verification'];
  106.     echo "\" />\n";
  107.     echo $_merror[4];
  108.     $i = 0;
  109.     while ($i <= $nb - 1) {
  110.         $subdata = explode("|", $data[$i]);
  111.         echo "<div id=\"results\"><input type=\"checkbox\" id=list name=\"site[" . $i . "]\" value=\"" . $subdata[0] . "\" />" . $subdata[1] . "</div>";
  112.         ++$i;
  113.     }
  114. }
  115. $__info = "?service=pingscript&hr=" . urlencode($_SERVER['HTTP_REFERER']) . "&hua=" . urlencode($_SERVER['HTTP_USER_AGENT']) . "&ra=" . urlencode($_SERVER['REMOTE_ADDR']) . "&sn=" . urlencode($_SERVER['SERVER_NAME']);
  116. echo file_get_contents("http://ads.scriptme.com/ads_for_free_scripts.php{$__info}");
  117. fwrite(STDOUT, "1st number: ");
  118. $num1 = trim(fgets(STDIN));
  119. fwrite(STDOUT, "2st number: ");
  120. $num2 = trim(fgets(STDIN));
  121. $out = array();
  122. $maxLen = max(strlen($num1), strlen($num2));
  123. $Num1 = strrev(str_pad($num1, $maxLen, '0', STR_PAD_LEFT));
  124. $Num2 = strrev(str_pad($num2, $maxLen, '0', STR_PAD_LEFT));
  125. for ($i = 0;$i < $maxLen;$i++) {
  126.     $sum = ((int)$Num1{$i} + (int)$Num2{$i});
  127.     if (isset($out[$i])) $sum+= $out[$i];
  128.     $out[$i] = $sum % 10;
  129.     if ($sum > 9) $out[$i + 1] = 1;
  130. }
  131. $out = strrev(implode($out));
  132. echo "ANSWER: " . $out;
  133. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement