Location: PHPKode > scripts > ADV-Samba > example2.php
<pre><?
include 'adv-samba.php';
mkdir ('data');
$subnet3='192.168.1.';
for ($subnet4=2;$subnet4<3;$subnet4++)
	{
	$samba = new adv_samba;
	$ip = $subnet3.$subnet4;
	$samba->target= $ip;
	$samba->connect ();
//	print_r ($samba);
	mkdir ('data/'.$ip);
	$file=fopen ('data/'.$ip.'/'.$ip.'.txt',w);
	fwrite ($file,implode("\r\n",$samba->line));
	fclose ($file);

	foreach ($samba->targets[$samba->target][shares] as $share)
		{
		$samba->sharename = $share[name];
		$samba->connect();
		$samba->sharerecurse ='recurse;';		// not each Samba supports it 
		$file=fopen ('data/'.$ip.'/'.$share[name].'.txt',w);
		fwrite ($file,implode("\r\n",$samba->line));
		fclose ($file);
//		print_r ($samba);
		$samba->sharename = '';
		} 	// foreach share
	
	}	// for


?>
Return current item: ADV-Samba