fail at a search

This commit is contained in:
Christine Dodrill 2016-02-06 01:37:47 -08:00
parent ce0fb7983a
commit 9e9747b1bf
2 changed files with 15 additions and 0 deletions

View File

@ -120,6 +120,16 @@ routes:
except:
fail()
post "/seek":
try:
var
query = $(request.formData.mget "query").body
myquery = sql("select * from quotes where message like ?")
rows = db.getAllRows(myquery, query)
resp $rows
except: fail()
get "/submit":
renderMustache "submit", submitTemplate, newContext()

View File

@ -10,6 +10,11 @@
<a href="/top">top</a>
<a href="/random">random</a>
<a href="/submit">submit</a>
<!--<form method="POST" action="/seek" enctype="multipart/form-data">
<input type="text" name="query" required>
<input type="submit" value="seek">
</form>-->
</div>
<h2>{{ title }}</h2>