2012-05-23 94 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命令行發送一個非常類似的請求! –