Help with COM objects in PHP

From: Date: Tue, 20 Aug 2002 23:47:14 +0000
Subject: Help with COM objects in PHP
Groups: php.general 
Request: Send a blank email to php-general+get-113392@lists.php.net to get a copy of this message
I have included my code below. This is my first experience trying to use COM objects in PHP. My problem is that the foreach loop does not output anything, regardless of whether or not there are files in the folder. Can anyone tell me what is wrong with my script? Thanks for any help. Kyle <?php session_start(); $objPath = "C:\\" . $_SESSION['user'] . "\\"; print $objPath; $objFileManager = new COM("Scripting.FileSystemObject") or die("cant open COM object"); if ($objFileManager->FolderExists($objPath)) { print "folder exists"; $objFolder = $objFileManager->GetFolder($objPath); $objFolder->Path; $fileCollection = $objFolder->Files; foreach ( $fileCollection as $file ){ print $file->Path; } } else print "doesnt exist"; ?>

« previous php.general (#113392) next »