2012-05-23 96 views
2

我想在此网站上提交一个带有卷曲的HTML表单。 http://pickupline.be/bekijk如何发送包含隐藏表单域的curl POST表单?

当您点击“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 

但我没有得到来自服务器的响应。 我也尝试保存饼干并使用卷曲,没有区别。

回答

2

隐藏只是浏览器不向用户显示该字段的属性。它仍然以与实际HTTP POST请求中的任何其他表单字段相同的方式发送。

+0

谢谢,你知道我为什么没有得到服务器的回应吗? – Kaprun123

+0

可能是因为你没有像浏览器一样发送请求。使用插件/工具来检查它发送的内容,然后确保你的curl命令行发送一个非常类似的请求! –