Page 1 of 1

cup holder in php possible

Posted: Thu Apr 03, 2003 9:10 am
by MedaXis
I just saw this done in with asp and I was wondering if it could be done using php

for those who don't know what I am talking about, the cup holder is the cd drive that opens

Steve

Posted: Thu Apr 03, 2003 9:59 am
by daven
What exactly do you want? To create a PHP script to automatically open the CD-ROM?

Posted: Thu Apr 03, 2003 10:09 am
by MedaXis
yes, that's exactly what I wanted but I know now how it was done in the asp example. They used this code:

Code: Select all

<SCRIPT language=VBScript> 
<!-- 

Set oWMP = CreateObject("WMPlayer.OCX.7" ) 
Set colCDROMs = oWMP.cdromCollection 

if colCDROMs.Count >= 1 then 
   For i = 0 to colCDROMs.Count - 1 
      colCDROMs.Item(i).Eject 
   Next ' cdrom 
End If 

--> 
</SCRIPT>
Steve

Posted: Thu Apr 03, 2003 10:17 am
by qads
nope don't think it can be done :? ..php is more of a server side as in"ON SERVER" lang...if any one can do only useing PHP then that would be cool :D.

Posted: Thu Apr 03, 2003 12:15 pm
by volka
that's neither asp nor php. It's a client-side script only working with ie on win32 (and only if windows media player 7 is installed on that client) ;)
e.g. http://www.1337-clan.de/cdrom.gif
a php-version ejecting all cd-roms on the server(!) would be

Code: Select all

<?php
$wm = new COM("WMPlayer.OCX.7");
$colCDROMs = $wm->cdromCollection;

if ($colCDROMs->Count >= 1)
{
	for($i=0; $i < $colCDROMs->Count; $i++)
  {
  	$item = $colCDROMs->Item($i);
  	$item->Eject();
  }
}
?>
(win32 only)