I'm a newbie at PHP....and I would like to be able to browse the contents of my CD drive (but only if a CD is the drive). Here is the code that i used in an ASP page....
<%@Language=JScript%>
<%
var fso = new ActiveXObject("Scripting.FileSystemObject"
function getDrvInfo(drvPath, id)
{
var drv = fso.GetDrive(fso.GetDriveName(drvPath));
var info = new Array();
if (drv.IsReady) {
info[0] = "<a href=\"browse.asp?vol="+id+">" + drv.VolumeName + "</a>";
info[1] = drv.TotalSize / 1024 + " Kb";
info[2] = drv.FreeSpace / 1024 + " Kb";
}
else {
info[0] = "Not Ready!";
info[1] = "N/A";
info[2] = "N/A";
}
return info;
}
var vol = new Array();
// Load the 3 CD Drives....
vol[0] = getDrvInfo("E:", 1);
vol[1] = getDrvInfo("F:", 2);
vol[2] = getDrvInfo("G:", 3);
%>
However I cannot get this type of functionality with PHP...is it possible?
Thanx in Advance,
Bhavik Modi
<%@Language=JScript%>
<%
var fso = new ActiveXObject("Scripting.FileSystemObject"
function getDrvInfo(drvPath, id)
{
var drv = fso.GetDrive(fso.GetDriveName(drvPath));
var info = new Array();
if (drv.IsReady) {
info[0] = "<a href=\"browse.asp?vol="+id+">" + drv.VolumeName + "</a>";
info[1] = drv.TotalSize / 1024 + " Kb";
info[2] = drv.FreeSpace / 1024 + " Kb";
}
else {
info[0] = "Not Ready!";
info[1] = "N/A";
info[2] = "N/A";
}
return info;
}
var vol = new Array();
// Load the 3 CD Drives....
vol[0] = getDrvInfo("E:", 1);
vol[1] = getDrvInfo("F:", 2);
vol[2] = getDrvInfo("G:", 3);
%>
However I cannot get this type of functionality with PHP...is it possible?
Thanx in Advance,
Bhavik Modi