Hamlets666 Posted October 24, 2006 Share Posted October 24, 2006 There it is : [code]<?php$url = "http://blabla.com";$x = 0;$proxy=@file("zz.txt");foreach($proxy as $v) list($ips[], $ports[]) = explode(':', $v);//while($x < 129) { //// There are 130 proxy`s$x = $x + 1;$fp = fsockopen($ips[$x], $ports[$x]);fputs($fp, "GET $url HTTP/1.0\r\nHost: $ips[$x]\r\n\r\n");while(!feof($fp)){ $line = fgets($fp, 4000); print($line);}fclose($fp);}?>[/code]And error : [i]Warning: fsockopen() expects parameter 2 to be long, string given in z:\home\localhost\www\anti2\xy.php on line 8Warning: fputs(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 9Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 10Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 11Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 10Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 11Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 10Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 11[/i].......Any idea why so? Proxy`s in zz.txt are like [b]33.33.33.33:33[/b]By the way : when i was writing : [code]<?php$proxy = "33.33.33.33";$port = 33;$url = "http://blabla.com";$fp = fsockopen($proxy, $port);fputs($fp, "GET $url HTTP/1.0\r\nHost: $proxy\r\n\r\n");while(!feof($fp)){ $line = fgets($fp, 4000); print($line);}fclose($fp);?>[/code] it was ok :-\ Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/ Share on other sites More sharing options...
Daniel0 Posted October 28, 2006 Share Posted October 28, 2006 Try this [code]<?php$url = "http://blabla.com";$proxies = @file("zz.txt");foreach($proxies as $proxy){ list($ip,$port) = explode(':',$v); $fp = fsockopen($ip,$port); fputs($fp,"GET $url HTTP/1.0\r\nHost: $ip\r\n\r\n"); while(!feof($fp)) { echo fgets($fp, 4000); } fclose($fp);}?>[/code]And quit spamming. Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115754 Share on other sites More sharing options...
Barand Posted October 28, 2006 Share Posted October 28, 2006 [code]foreach($proxy as $v) list($ips[], $ports[]) = explode(':', $v);[/code]It could be that there is a blank entry in the ports array try this check[code]echo '<pre>', print_r($ports, true), '</pre>';[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115756 Share on other sites More sharing options...
Barand Posted October 28, 2006 Share Posted October 28, 2006 @DanielI wouldn't call a "bump" every couple of days "spamming" Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115757 Share on other sites More sharing options...
Daniel0 Posted October 28, 2006 Share Posted October 28, 2006 Well ok... they could still be deleted now... Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115760 Share on other sites More sharing options...
php_joe Posted October 28, 2006 Share Posted October 28, 2006 I wanted to delete a post that I made a couple of days ago. How does one do this? I didn't think that it was an option so I had to settle for erasing the post. ??? Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115762 Share on other sites More sharing options...
Barand Posted October 28, 2006 Share Posted October 28, 2006 It's a moderator-only option.Having had their question answered, people were removing the posts, thus removing from the archive info that would be useful to others with a similar problem. Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115763 Share on other sites More sharing options...
Barand Posted October 28, 2006 Share Posted October 28, 2006 PS file() function leaves linefeeds on the end which could also be screwing things up.try[code]<?phpforeach($proxy as $v) list($ips[], $ports[]) = explode(':', trim($v));?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115773 Share on other sites More sharing options...
Hamlets666 Posted October 28, 2006 Author Share Posted October 28, 2006 Sorry about "spamming" :)[code]<?php$url = "http://blabla.com";$proxies = @file("zz.txt");foreach($proxies as $v){ list($ip[], $port[]) = explode(':', trim($v)); $fp = fsockopen($ip,$port); fputs($fp,"GET $url HTTP/1.0\r\nHost: $ip\r\n\r\n"); while(!feof($fp)) { echo fgets($fp, 4000); } fclose($fp);}?>[/code]It`s last what I tried :) But again : [i]Warning: fsockopen() expects parameter 1 to be string, array given in z:\home\localhost\www\777\newww.php on line 8Warning: fputs(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 9Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 10Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 12Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 10Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 12[/i]And error with line10,12 repeats a lot :-[ Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115864 Share on other sites More sharing options...
Barand Posted October 28, 2006 Share Posted October 28, 2006 Did you check for blanks as I suggested earlier Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115952 Share on other sites More sharing options...
Daniel0 Posted October 28, 2006 Share Posted October 28, 2006 Try this: [code]<?php$url = "http://blabla.com";$proxies = @file("zz.txt");foreach($proxies as $v){ list($ip, $port) = explode(':', trim($v)); $fp = fsockopen($ip,$port); fputs($fp,"GET $url HTTP/1.0\r\nHost: $ip\r\n\r\n"); while(!feof($fp)) { echo fgets($fp, 4000); } fclose($fp);}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-115954 Share on other sites More sharing options...
Hamlets666 Posted October 29, 2006 Author Share Posted October 29, 2006 Daniel0, ok :) Look`s like it worked ;) But how about if $url = bla.com/folder/?666 how to send this ?666 with get ? Will it work if write just $url = bla.com/folder/?666 ? How do you all think? Quote Link to comment https://forums.phpfreaks.com/topic/24926-open-url-with-proxy/#findComment-116294 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.