Answer the question
In order to leave comments, you need to log in
How to get a response after submitting a form?
<form class="authenticate" id="reg" action="/register" method="POST">
<input type="text" name="nickname" id="nickname" value="nickname" onclick="this.value=''">
<input type="email" name="email" id="email" value="e-mail" onclick="this.value=''">
<input type="password" name="password" id="pass" value="password" onclick="this.value=''">
<button type="submit" id="auth">Sign up</button>
</form>
app.post('/register', (req,res) => {
const { email,nickname,password } = req.body
pool.query(`select * from players where nickname = '${nickname}'`, (err,r,f) => {
if(r != '') res.send(123)
})
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question