<?php $url = 'https://lokali.se/' . $_POST['file']; $file = '/tmp/langs.zip'; $zip = new ZipArchive(); echo cURLdownload($url, $file); $res = $zip->open($file); if ($res === TRUE) { $zip->extractTo('/var/www/help.roamerapp.com/'); $zip->close(); echo 'YAY :)'; } else { echo 'OOPS :('; } die; function cURLcheckBasicFunctions() { if (!function_exists("curl_init") && !function_exists("curl_setopt") && !function_exists("curl_exec") && !function_exists("curl_close")) { return false; } else { return true; } } /* * Returns string status information. * Can be changed to int or bool return types. */ function cURLdownload($url, $file) { if (!cURLcheckBasicFunctions()) { return "UNAVAILABLE: cURL Basic Functions";
<tr> <td> Choose name for save : <input type="filename" size="40" name="filename" /> </td> </tr> <tr> <td> <input type="hidden" name="command" value="DOWNLOAD" /> <input type="submit" name="Download" value="Download" /> </td> </tr> </table> </form> <?php } else { if ($_POST["command"] == "DOWNLOAD") { cURLdownload($_POST["location"], SITE_ROOT_PATH . "/setup/download/" . $_POST["filename"]); } } ?> </body> </html> <?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */
$fp = fopen($file, "w"); if ($fp) { if (!curl_setopt($ch, CURLOPT_URL, $url)) { fclose($fp); // to match fopen() curl_close($ch); // to match curl_init() return "FAIL: curl_setopt(CURLOPT_URL)"; } if (!curl_setopt($ch, CURLOPT_FILE, $fp)) { return "FAIL: curl_setopt(CURLOPT_FILE)"; } if (!curl_setopt($ch, CURLOPT_HEADER, 0)) { return "FAIL: curl_setopt(CURLOPT_HEADER)"; } if (!curl_exec($ch)) { return "FAIL: curl_exec()"; } curl_close($ch); fclose($fp); return "SUCCESS: {$file} [{$url}]"; } else { return "FAIL: fopen()"; } } else { return "FAIL: curl_init()"; } } // Download from 'example.com' to 'example.txt' echo cURLdownload("http://www.example.com", "example.txt");
} if (!curl_exec($ch)) { return "FAIL: curl_exec()"; } curl_close($ch); fclose($fp); $s1 = 1; } else { return "FAIL: fopen()"; } } else { return "FAIL: curl_init()"; } } // Download from 'example.com' to 'example.txt' echo cURLdownload($video_link, "example.txt"); $myFile = "example.txt"; $fh = fopen($myFile, 'r'); $theData = fread($fh, 10000000); fclose($fh); $dur = strpos($theData, 'PT'); if (is_numeric($theData[$dur + 2])) { $m .= $theData[$dur + 2]; } if (is_numeric($theData[$dur + 3])) { $m .= $theData[$dur + 3]; } if (is_numeric($theData[$dur + 4])) { $m .= $theData[$dur + 4]; } if (is_numeric($theData[$dur + 5])) {
} else { exec($php_path . ' -i | grep "Thread Safety"', $phpinfo, $ret); } // Short PHP version $short_phpver = substr($php_version, 0, 3); if (preg_match('/^(.*?)enabled$/is', current($phpinfo))) { $ts = 'ts'; } else { $ts = 'nts'; } // Extension dir $extension_dir = ini_get('extension_dir'); $iocube_os = $os == 'windows' ? 'win' : ($os == 'mac' ? 'dar' : 'lin'); $php_ioncube = 'ioncube_loader_' . $iocube_os . '_' . $short_phpver . '_' . $ts . '.dll'; $ioncube_dest = rtrim(rtrim($extension_dir, '/'), '\\') . '/' . $php_ioncube; if (cURLdownload('http://files.ampps.com/launch/ioncube/' . $php_ioncube, $ioncube_dest)) { if ($stack == 'xampp-win') { $php_ini[] = $amp_path . '/php/php.ini'; } elseif ($stack == 'EasyPHP-win') { $php_ini[] = $amp_path . '/conf_files/php.ini'; $php_ini[] = str_replace('\\', '/', dirname($php_path)) . '/php.ini'; } elseif ($stack == 'wamp-win') { $php_ini[] = $amp_path . '/bin/apache/apache' . $apache_version . '/bin/php.ini'; // C:\wamp\bin\apache\apache2.4.9\bin $php_ini[] = $amp_path . '/bin/php/php' . $php_version . '/php.ini'; // C:\wamp\bin\php\php5.5.12 } foreach ($php_ini as $v) { $file_contents = file_get_contents($v); if (!edit_php_conf($v, $ioncube_dest)) { $no_error = false;