I'm currently building a very simple server with raspberry pi, with very very little knowledge about sql, php....
When the user goes to the following url "RPi_IP"/main.php?addr=10&value=100, I want it to run a Bash script:
Executing the URL I always get the following output:
Code: Select all
<html><body><h1>Hello! </h1> Logic Address <?php echo$_GET["addr"]; ?><br> Value <?php echo$_GET["value"]; ?><br> $old_path = getcwd(); exec('cd'); exec('./writeknx $addr $value'); chdir($old_path);
Logic Address 10
With Value 100
$output = exec('ls -l'); $old_path = getcwd(); $output = exec('cd'); $output = exec('./writeknx $addr $value'); chdir("$old_path");
Thank you in advance!