html5 - Newbie's question: Why can't the post request of the form be processed by routing?
迷茫
迷茫 2017-06-10 09:49:12
0
1
808

Front desk ws.html

<form method="post">  
    <p class="form-group" >
            <lable for="name">手机号</lable>
            <input type="text" class="form-control" id="name" placeholder="请输入你的手机号" name="pnum">
            <lable for="price">QQ号</lable>
            <input type="text" class="form-control" id="price" placeholder="请输入你的qq号" name="qnum">
            <lable for="num">邮箱</lable>
            <input type="text" class="form-control" id="num" placeholder="请输入你的邮箱" name="email">          
    </p>
    <button type="submit" class="btn btn-default">提交</button>
</form>

Routing ws.js

router.post('/ws',function(req,res,next){
    console.log(req,body);
    res.render('suc',{
       message : "恭喜你完善成功",
    })
})

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
巴扎黑

This route is not entered at all. Is your log information output?

Your <form method="post"> does not have action, and it should post to the homepage of the website by default.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template