Ok, the problem is simple, though not so simple to explain. I have this PHP-file called “test.php” with the following code:
[php]<?php
$search = $_POST[‘search’];
$filepath = “/usr/sbin”;
exec("ONE $search -command $filepath ");
fopen($filepath, “rw”);
?>[/php]
ONE is a bash searchscript that includes a little “grep” and “sort” that takes one argument.
When I switch $search for a real word and run the file in a shell “php test,php” it runs like a charm and throws up all hits on a new webpage which is an included feature of ONE.
The argument $search derives from a post from an HTML-page that posts the searchword to the PHP-file. It’s captured and set as $search = $_POST[‘search’];
If I switch exec("ONE $search -command $filepath "); to echo("ONE $search -command $filepath "); and then put a searchword in the searchbox in the HTML-page and hit “Search”, it moves over to “test.php” and throws up “ONE searchword -command /usr/sbin” on the page, so that proves the variable is correctly transferred to the PHP-file.
BUT, when I do the search from the HTML-page with the “test.php” as described above it gives back just a blank page. WHY?