function insertdir( &$db, $path, $parent )
{
$dir = opendir( $path );
while( ( $child = readdir( $dir ) ) !== false )
{
if( ( $child != '.' ) AND ( $child != '..' ) )
{
if( is_dir( $path.'/'.$child ) )
{
$result = $db->Execute( 'SELECT mkdir(''. $child.'', '.$parent');' );
if( $result->fields[0] == 't' )
{
print $path.'/'.$child.'/';
$result->Close();
$id = $db->pg_insert_id( 'categories', 'id' );
if( !insertdir( $db, $path.'/'.$child, $id )
{
$db->RollbackTrans();
return false;
}
}
else
{
$result->RollbackTrans();
$result->Close();
return false;
}
}
else
{
$result = $db->Execute( 'SELECT mk(''.$child.'', '.$parent.', 'testowy plik');' );
if( $result->fields[0] == 't' )
{
print $path.'/'.$child;
$result->Close();
}
else
{
$result->Close();
$db->RollbackTrans();
return false;
}
}
}
closedir( $dir );
}
return true;
}
error_reporting( 'E_ALL' );
set_time_limit( 0 );
include( '/usr/local/htdocs/adodb/adodb.inc.php' );
$db = NewAdodbConnection('postgres7') or die('Cannot open ADOdb');
$db->Connect('localhost', 'php_pl', 'o kurka...', 'postgres') or die('Cannot Connect');
$db->BeginTrans();
if( insertdir( $db, '/usr', 1 ) )
{
$db->CommitTrans();
}
else
{
print $db->ErrorMsg();
}
$db->Close();
$dir = opendir( './' );
while( ( $child = readdir( $dir ) ) !== false )
{
print $child;
}
closedir( $dir );
?></pre>
[/php:1:27cda00d7c]Teraz caly problem polega na tym, ze skrypt pokazuje taki output
Cytat
<html><body></body></html>
zamiast czegokolwiek innego. Nie wiem czemu sie tak dzieje 
Ps. Mam apache 2.0.47 i php5 (--with-apxs2 przy instalacji) na linuxie slackware.
Ps2. Jutro wyjezdzam na troche wiec nie bede odpowiadal na posty wyslane pozniej niz dzisiaj