I'm trying to find a way for PHP to detect the drive letter of the USB my app is on, but I'm not having any luck.
I'm making a desktop which goes hand in hand with the apps I installed from portableapps.com. The main desktop and all the apps are on a USB drive; the PHP files are stored in the USB version of xampp.
Currently I have a conditional statement set up where if I was to click a desktop icon for one of the portable apps, it would append "?app=APPNAME" which would then be picked up by the conditional and open the app.
<?php
$app = $_GET['app'];
if ($app == 'pidgin') {
$addr = "E:/PortableApps/PidginPortable/PidginPortable.exe";
exec ($addr,$output, $return);
}
?>
I want to be able to plug this drive into any computer and not run into problems opening the apps, so is there a way to remove the E:/ in the file location and still have them open or at least a way to detect what drive letter the USB is using and change that part of my code based on what it detects?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…