diff options
author | KatolaZ <katolaz@freaknet.org> | 2020-01-08 19:56:11 +0000 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2020-01-08 19:56:11 +0000 |
commit | 3e559a8ecad2c03880c1105a729b69faaa2eb362 (patch) | |
tree | e480f9660f41fc80536f66839e7443af8ccf1231 /search_cgi | |
parent | 8545883d676207a4f0ed01079aa8fccfa1e31c7a (diff) |
improve presentation in searcg_cgi
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 |