fail at a search
This commit is contained in:
parent
ce0fb7983a
commit
9e9747b1bf
|
@ -120,6 +120,16 @@ routes:
|
||||||
except:
|
except:
|
||||||
fail()
|
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":
|
get "/submit":
|
||||||
renderMustache "submit", submitTemplate, newContext()
|
renderMustache "submit", submitTemplate, newContext()
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,11 @@
|
||||||
<a href="/top">top</a>
|
<a href="/top">top</a>
|
||||||
<a href="/random">random</a>
|
<a href="/random">random</a>
|
||||||
<a href="/submit">submit</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>
|
</div>
|
||||||
|
|
||||||
<h2>{{ title }}</h2>
|
<h2>{{ title }}</h2>
|
||||||
|
|
Loading…
Reference in New Issue