HTML Form that sends data entered to a bash script as variables
Hi All
I've been banging my head against the wall with this one. I have a script that runs as follows: Code:
./script.sh var1 var2 var3 Code:
<html> The requested URL /cgi-bin/addcustomer-ips.sh was not found on this server ... but it definately is in the cgi-bin directory! It's worth noting that the bash script is written so that if $1 = "webui" it knows that it's being run from the apache2 server and not the command line so it skips the interactive parts of the script... I didn't want to write the same thing twice ;) . Also "CUSTOMER_NAME" and "IP_ADDRESS" are variables in the script. Any ideas or a point in the right direction would be most appreciated! TIA, Simplified |
Hi All
Here's an update... I've actually gotten this to work by using a php page. Here's the block of code I used, if you have this problem I hope it helps you out! The first page is a form: (filename: new_customer.php) Code:
<html> Code:
<?php ***Big hint*** - you will need to ensure that the script (in the above example /scripts/addcustomer.sh) is executable by the user www-data (or equivalent user). Thanks to all that took a peek! |
p.s. if you're not having any luck with the user permissions for user www-data, try sticking this code in - it'll tell you who the user is :D
Code:
<?php |
All times are GMT -5. The time now is 01:37 PM. |