scrappy1855 Posted January 8, 2010 Share Posted January 8, 2010 I have a Php file that processes my form data into a csv file after that is complete i need to execute a vbscript file that will loop through all of the form submissions and processes them along with an access vba process. But i'm having issues executing the vbs file from my php file. Here is my code posted below. The vbscript resides on my webserver folder but really i'd like to if able launch it from a network drive. Any assistance woudl be greatly appreciated. <?php if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { $uri = 'https://'; } else { $uri = 'http://'; } $uri .= $_SERVER['HTTP_HOST']; $customernumber = $_POST["customernumber"]; $yearwkstart = $_POST["yearwkstart"]; $yearwkend = $_POST["yearwkend"]; $email = $_POST["email"]; $num=''; do{ $file = 'c:\asys_reports\baddebtfiles\baddebt'.$num.'.csv'; }while(file_exists($file) && $num-->intval(PHP_INT_MAX+1)); $values = "$customernumber\r\n$yearwkstart\r\n$yearwkend\r\n$email\r\n"; IF (!isset($_POST["customernumber"])) { header('Location: '.$uri.'/index_files/baddebtquery.htm'); } elseif (empty($customernumber) || empty($yearwkstart) || empty($yearwkend) || empty($email)) { header('Location: '.$uri.'/index_files/error.htm'); } else { $values = "$customernumber,$yearwkstart,$yearwkend,$email,"; $fp = fopen($file, "w") or die("Couldn't open $file for writing!"); $numBytes = fwrite($fp, $values) or die("Couldn't write values to file!"); fclose($fp); Echo Exec('baddebtfiles.vbs') header('Location: '.$uri.'/index_files/complete.htm'); } ?> Link to comment https://forums.phpfreaks.com/topic/187736-php-execute-a-vbscript-on-the-server/ Share on other sites More sharing options...
PHP Monkeh Posted January 8, 2010 Share Posted January 8, 2010 Is the problem that the script doesn't execute, or that you just want to be able to launch it with a network drive location? Link to comment https://forums.phpfreaks.com/topic/187736-php-execute-a-vbscript-on-the-server/#findComment-991207 Share on other sites More sharing options...
scrappy1855 Posted January 8, 2010 Author Share Posted January 8, 2010 the problem is that it doesn't execute. Is the problem that the script doesn't execute, or that you just want to be able to launch it with a network drive location? Link to comment https://forums.phpfreaks.com/topic/187736-php-execute-a-vbscript-on-the-server/#findComment-991224 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.