是否可以發送數據,您只需使用url就可以正常使用提交按鈕發送數據?如何將POST轉換爲網址?
下面是代碼的例子從一個網站有這樣一個按鈕:
<form method="POST" action="Action.php?action=338&n=688&t=mine"><input type="hidden" id="Mine688" value="1" name="duree"><button value="submit" class="boutonsGeneral" type="submit" name="travail"><span title="" class="infoBoutonsGeneral"><span class="boutonsGeneral_separateur"> </span><span class="boutonsGeneral_gain" id="gainMine688"><img width="48" height="24" src="images/items/itemArgent.png">+2,18</span></span>Munca <span class="boutonsGeneral_duree boutonsGeneral_dureeMoins" id="dureeMine688">1 hour</span></button></form>
這是直播HTTP頭當我點擊該按鈕:
ww.kraljevine.com/Action.php?action=338&n=688&t=mine
POST /Action.php?action=338&n=688&t=mine HTTP/1.1
Host: ww.kraljevine.com/
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ro-ro,ro;q=0.8,en-us;q=0.6,en-gb;q=0.4,en;q=0.2
Accept-Encoding: gzip, deflate
Referer: ww.kraljevine.com/EcranPrincipal.php?l=8
Cookie: PHPSESSID=ec95ed7caf7c28f8a333; KC=account_name; KC2=1502cae30e04f5f55963e93; > > Glup=274; pageTamponVue=1
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 22
duree=1&travail=submit
我想要做的是通過網址發送帖子。喜歡的東西:
http://www.kraljevine.com/Action.php?action=338&n=688&t=mine(直到這裏是從網站上的鏈接,我想補充這一點)綿延= 1個&勞苦=提交 不工作http://www.kraljevine.com/Action.php?action=338&n=688&t=mine&duree=1&travail=submit也正因爲如此,我想,如果能夠做到這一點。
您可以使用cURL發送後置參數。 – OptimusCrime
使用方法GET男人。它更簡單。使用get你有在url中顯示的變量。 – Gimmy
無理由使事情變得複雜。如果參數在QUERYSTRING中使用GET,如果它們在表單上使用POST。就是這樣簡單,並且都在php代碼中以相同的方式訪問。 – CarlosB