first commit

This commit is contained in:
Kai Hendry
2011-11-04 23:55:16 +01:00
commit 7fb4cf145c
13 changed files with 783 additions and 0 deletions

10
grep.php Normal file
View File

@@ -0,0 +1,10 @@
<?
if (empty($_GET['q'])) { die(); }
$QUERY=urldecode(escapeshellarg(urlencode($_GET['q'])));
//$fp = fopen('debug.log', 'a');
//fwrite($fp, $_GET['q'] . " : " . $QUERY . "\n");
//fclose($fp);
exec("grep -hi $QUERY *.txt", $array);
$data = json_encode($array);
echo $_GET['jsoncallback'] . '(' . $data . ');';
?>