我想在此网站上使用curl 提交一个html 表单。 http://pickupline.be/bekijk
当您点击“Stem”时,它会发送一个帖子表单到 http://pickupline.be/submitVote .
表单需要以下字段:
<input type="text" id="num" name="num" class="required center_text">
<input type="text" id="firstname" name="fname" class="fname required" >
<input type="text" id="lastname" name="lname" class="lname required" >
<input type="text" id="mail" name="email" class="required email" >
<select name="birthday_day" class="required birthday_day">
<option selected value="">DD</option>
<option value="1">1</option>
<select name="birthday_month" class="required birthday_month">
<option selected value="">MM</option>
<option value="1">1</option>
<select name="birthday_year" class="required birthday_year">
<option selected value="">JJ</option>
<option value="2000">2000</option>
<input type="checkbox" id="chkOpdehoogte" name="newsletter"><label for="chkOpdehoogte">Ik wil op de hoogte blijven van nieuwe inzendingen</label>
<input type="checkbox" id="chkAgreeConditions" name="agree" class="required"><label for="chkAgreeConditions">Ik ga akkoord met het <a href="http://pickupline.be/reglement" target="_blank">reglement</a></label>
<input type="hidden" id="pickupline_id" name="id">
<input type="submit" value="STEM">
请注意,ID 是隐藏的。 这是我到目前为止所尝试过的:
curl -v --data 'num=${nummer}&fname=${voornaam}&lname=${achternaam}&email=${mail}&birthday_day=${dag}&birthday_month=${maand}&birthday_year=${jaar}&agree="yes"&id=100' http://pickupline.be/submitVote --referer http://pickupline.be/bekijk
但我没有收到服务器的响应。 我也尝试过保存cookie并与curl一起使用它们,没有区别。
最佳答案
隐藏只是浏览器不向用户显示该字段的一个属性。它仍然以与实际 HTTP POST 请求中任何其他表单字段相同的方式发送。
关于html - 如何使用curl 发送包含隐藏表单字段的POST 表单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10717890/