PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Tomasz Malewski   ADV-Samba   example1.php   Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: PHP Example how to use class
Class: ADV-Samba
Scan resources made available by SMB shares
Author: By
Last change:
Date: 15 years ago
Size: 717 bytes
 

Contents

Class file image Download
<pre><?

include 'adv-samba.php';
$samba = new adv_samba;

$samba->target= '192.168.1.105';
$samba->connect ();

echo
" SAMBA Shares on target ".$samba->target." :<Br>";
foreach (
$samba->targets[$samba->target][shares] as $share)
    {
    echo
"$share[name]<br>";
   
$sharenames[]=$share[name];
    }
// foreach
echo "<hr>";

echo
" SAMBA remote DIR command on each share:<br>";
foreach (
$sharenames as $sharename)
    {
   
$samba->sharename = $sharename;
// $samba->sharerecurse ='recurse;'; // uncomment to recursive samba listing directory, not each samba version support it.
   
$samba->connect();
    echo
"$sharename<br>".implode("\r\n",$samba->line).'<br>';
    }
echo
"<hr>";

//print_R ($samba);



?>