Jump to content

void_set

New Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by void_set

  1. Hello how can i modify this script to search in all subdirectories to get only one new directory? THX! This little script only search in current $path for newest directory but i also need to search in all subdirectories <?php function getNewestDir($path) { $working_dir = getcwd(); chdir($path); ## chdir to requested dir $ret_val = false; if ($p = opendir($path) ) { while (false !== ($file = readdir($p))) { if ($file{0} != '.' && is_dir($file)) { $list[] = date('YmdHis', filemtime($path.'/'.$file)).$path.'/'.$file; } } rsort($list); $ret_val = $list[0]; } chdir($working_dir); ## chdir back to script's dir return $ret_val; } ?>
  2. So basically this will opens a port at 3053 and i want to log those IP which connects to that port into port.txt, but it wont log, can you help me why ? <?php $ip = $_SERVER['REMOTE_ADDR']; // port number $port = 3053; // open the socket $socket = socket_create_listen($port); if ($socket === false) die("Error"); while (true) { // accept a request $client = socket_accept($socket); while (true) { $buf = socket_read($client, 2048); if ($buf == "") break; echo $buf; $fp = fopen("port.txt", 'a+'); fwrite($fp, "".$ip."\n"); fclose($fp); } socket_close($client); } socket_close($socket);
  3. Is it possible to get bittorrent peer list (IP list) via php, udp protocol ? txh!
  4. resumepos The position in the remote file to start downloading from. I do know that but i need to download from 500MB file only 1-2MB and resumepos is for position where to start from
  5. Is it possible to connect via php to ftp and download part of file (about 2MB from file)
  6. I am trying to connect to cryptochat.pw chat service via php but i cant, can you tell me whats going wrong pls. <?php $curl_header = array('X-Requested-With: XMLHttpRequest'); // POST the login details along with other required details to the login process page $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'http://cryptochat.pw/'); curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_header); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 2); curl_setopt($ch, CURLOPT_POST,2); curl_setopt($ch, CURLOPT_POSTFIELDS,urlencode('nick=test&name=aWJuRXozaWhBWHVIODZIY3QrbUJXbGtpTElqazUwUGZEbEU3TzduaUl2UGwzVnU4c2dXYnFtaXVyellSRXZWc2dTQzdQQXdUTXhrMDd1NHZQa1hPQ3c9PQ')); curl_setopt($ch, CURLOPT_COOKIEJAR, './cookies1.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, './cookies1.txt'); curl_exec($ch); // Once logged in, we use the same Cookies to allow us to view the home page // Change the url to point to any page within the InvisionPower website that requires login $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://cryptochat.pw/index.php?chat=aWJuRXozaWhBWHVIODZIY3QrbUJXbGtpTElqazUwUGZEbEU3TzduaUl2UGwzVnU4c2dXYnFtaXVyellSRXZWc2dTQzdQQXdUTXhrMDd1NHZQa1hPQ3c9PQ&pos=0"); curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_header); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, './cookies1.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, './cookies1.txt'); $result = curl_exec($ch); echo $result; // Close the cURL to free up resources curl_close($ch); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.