I cannot get a button on my webpage to execute a python3 script that is also inside the same folder in the server as the rest of the html and php files.
exec();
system();
escapeshellcmd();
shell_exec()
all of these commands are not working for me right now. I have chmod +x my .py file and included #!/usr/bin/env python3 at the very beginning of my python file.
<?php
if( isset($_POST['runScript'])){
$command = escapeshellcmd('/nfs/nfs7/home/team51/cgi-
pub/dataProcess.py');
$output = shell_exec($command);
echo $output;
}
?>
<form method="post">
<input type="submit" name="runScript" value="runScript">
</form>
In the end the python script should place a csv file in the same folder as the rest of the files. But I am getting nothing.
Some functions just print back "Array()"