1
0
Fork 0

only displaying email if it contains something

2015
joates 10 years ago
parent 496eaa2f04
commit 453bbfa09b

@ -31,7 +31,7 @@
<input type="text" name="email">
<span class="help-block">we'll send you info about future events</span>
<label class="checkbox text-info">
<input type="checkbox" name="paris"> Nov 2014 (Paris)
<input type="checkbox" name="paris"> Paris Nov.2014?
</label>
<button type="submit" class="btn">Send</button>
</fieldset>

@ -23,14 +23,15 @@
<br /><br />
<ul class="nav nav-list">
<form method="GET" action="http://clevo:8000/email">
<!-- WARNING: This only works for development system (localhost) -->
<form method="GET" action="http://localhost:8000/email">
<fieldset>
<legend>JOIN US</legend>
<label class="text-info">Enter your email..</label>
<input type="text" name="email">
<span class="help-block">we'll send you info about future events</span>
<label class="checkbox text-info">
<input type="checkbox" name="paris"> Nov 2014 (Paris)
<input type="checkbox" name="paris"> Paris Nov.2014?
</label>
<button type="submit" class="btn">Send</button>
</fieldset>

@ -14,7 +14,8 @@ function handler(req, res) {
if (/^\/email\?/.test(req.url)) {
var params = require('url').parse(req.url, true)
console.log('got email:', params.query)
if (params && params.query.email) // @TODO: validate input
console.log('got email:', params.query)
res.statusCode = 302
res.setHeader('Location', '/')
return res.end()

Loading…
Cancel
Save