diff options
Diffstat (limited to 'search_cgi')
-rwxr-xr-x[-rw-r--r--] | search_cgi | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/search_cgi b/search_cgi index 624ad2e..425ce55 100644..100755 --- a/search_cgi +++ b/search_cgi @@ -4,8 +4,10 @@ echo "Content-type: text/html\n\n" query="${QUERY_STRING}" - -echo "<html><body><div>Search for: </div><form method='GET' action='/cgi-bin/search_cgi'>" +echo "<html><head><style type='text/css'>" +echo "body{padding: 20px; margin: 40px auto;line-height: 1.6;font-size: 18px; color:#444;}" +echo "</style></head>" +echo "<body><div>Search for: </div><form method='GET' action='/cgi-bin/search_cgi'>" echo "<input type='text' name='query'></input>" echo "<input type='submit' value='Search!'></input>" echo "</form>" @@ -17,15 +19,17 @@ terms=$(echo "${query}" | tr '&' '\n' | grep -E "^query" | sed -E 's/^query=//') if [ -z "$terms" ]; then exit 0 else - search=$(echo "$terms" | sed -E 's/\%20/ /g') + search=$(echo "$terms" | sed -E 's/\+/ /g') res=$(./search_repo ./ $search ) if [ -z "$res" ]; then echo "<p>No results for \"$search\":" exit 0; else echo "<p>Results for \"$search\"" + echo "<ul>\n" for r in $res; do - echo "<div><a href=\"$r\" target='new'>$r</a></div>\n" + echo "<li><div><a href=\"$r\" target='new'>$r</a></div></li>\n" done + echo "</ul>" fi fi |