Welcome to Dream.In.Code
Become a PHP Expert!

Join 137,427 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,885 people online right now. Registration is fast and FREE... Join Now!




how to find list of drives in local pc in php

 
Reply to this topicStart new topic

how to find list of drives in local pc in php, i want to find list of drives in local pc like c: ot d:, if anyone can

swetapatel
18 Jan, 2008 - 01:40 AM
Post #1

New D.I.C Head
*

Joined: 17 Jan, 2008
Posts: 3


i want to find list of drives in local pc like c: ot d:, if anyone can know function for that php or javascript.

i have tried this javascript cod

<HTML>
<HEAD>

<script language=JavaScript>

function ShowAvailableDrives()
{
document.write(GetDriveList());
}

function GetDriveList()
{
var fso, s, n, e, x;
fso = new ActiveXObject("Scripting.FileSystemObject");
e = new Enumerator(fso.Drives);
s = "";
do
{
x = e.item();
s = s + x.DriveLetter;
s += ":- ";
if (x.DriveType == 3) n = x.ShareName;
else if (x.IsReady) n = x.VolumeName;
else n = "[Drive not ready]";
s += n + "<br>";
e.moveNext();
} while (!e.atEnd());

return(s);
}

</SCRIPT>
</HEAD>

<BODY>
<P>
<script language=JavaScript> ShowAvailableDrives(); </SCRIPT>
</P>
</BODY>
</HTML>

but it says that automation server can't create object in IE and in firefox it's not working. please tell me if you have any solutions.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/5/08 04:48AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month