I am working on a project that will enable user to launch tools from a webpage. the page is designed using php. I have WAMP server installed on the my PC and I can click a button to create and write a new batch file on the C drive with the path of applications to be launched which are pulled from the db when the user selects them on the page. Now this works when I am doing it on the WAMP server on my PC. I have to upload the script to a server at my work that is hosted on the same LAN. only problem is I can't seem to be able to create or write to a file on the user PC.
From my understanding it is not mapping the drive for the current PC. here is how I did when it was on my PC.
$file_path="C\\test.bat"
function runApp($file_path, $appPath){
$bat_file = fopen($file_path, "w");
fwrite($bat_file, "start ".$appPath." \n");
fwrite($bat_file, "echo exit \n");
fclose($bat_file); //close file after updating batch file
}
in order to make it work from the server at work, I tried
$ip=$_SERVER['REMOTE_ADDR'];
$file_path="user:pass@".$ip."\\F:\\test.bat";
but it is still not working. What am I missing? Any help would be greatly appreciated
or please let me know if there is any other way I could launch a batch file or any file form the php site