Are we able to run a batch file using PHP?
Am trying to transform an .xml file into HTML for browser view, it’s not working please advice me!
<html>
<head>
<script type=”text/javascript”>
function myfunc(){
<?php
exec(‘trans.bat’);
?>
}
</script>
</head>
<body>
<input type=”button” onclick=”myfunc()” value=”Click!” />
</body>
it has simply creating the html-out.html but not performing the required action!
<?php
$jarfile=”
$input=”uploadbookinfo.xml”;
$xslt=”uploadbookinfo_viewer.xslt”;
$forward=”>”;
$output=”uploadhtml-out.html”;
$process=`java -jar $jarfile $input $xslt $forward $output
echo “<pre>$forward</pre>”;
?>
result is same as above!!
========================
<?php
if(isset($_POST[‘submit’])){
exec(‘trans.bat’);
echo “nDone!”;
} else {
?>
<form action=”” method=”post”>
<input type=”submit” name=”submit” value=”Transform”>
</form>
<?php
}
?>
result is same as above!!
any help???
Please note: When am running the batch file manually it’s working file.
Thanks in Advance,
Thirilog