Help me to make a script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jose Arce
Forum Commoner
Posts: 37
Joined: Wed May 01, 2002 5:05 pm

Help me to make a script

Post by Jose Arce »

I'm trying to make a script that will check on several ips to see if they have an FTP server...well, the script goes like this:

Code: Select all

<?
/* Jose Arce Ping 0.1 */
$i = 0 ;
$servidores = $ip.$i ;
while (++$i <= 255) &#123;
$conexion = ftp_connect($servidores);
$conectar = ftp_login($conexion, 'anonymous', 'on@thenet.com') ;
if ((!$conexion) || (!$conectar)) &#123;
		echo "$servidores -----> imposible conectarse anonimamente" ;
		die;
	&#125;else&#123;
		echo "$servidores -----> <font color=red>si conecta anonimamente" ;
		ftp_close($conexion); 
	&#125;
&#125;
?>
The problem is that it doesn't work, the reason is in my other post...the numbers of the ips won't join...i hope you can help me :D
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

uh-ha
I supported a port-scanner 8O
Post Reply