0
對我來說,唯一的問題是,它沒有爲形式的HTML按鈕提交它使用的CSS風格的自定義按鈕沒有name屬性。 這是形式登錄到網站使用PHP和捲曲
<form name="login_form" method="post" action="index.php" onsubmit="loginFormSubmit(this)">
<div style="position:absolute;top:-1500px;"><input type="submit" value="sub"></div>
Username:<input name="username" size="20" maxlength="32"><br><br>
Password:<input type="password" name="passwd" size="20" maxlength="32">
</form>
按鈕的HTML代碼,如果標籤外
<div style="position: absolute; width: 54px; height: 20px; top: 382px; margin-left: 312px; cursor: pointer; color: rgb(255, 255, 255); font-style: normal; font-weight: normal;" onmouseover="fFOB(this)" onmouseout="fFNN(this)" onclick="loginFormSubmit(document.login_form)">Login</div>
,這是我的PHP代碼
<?php
$username="yyyyy";
$password="xxxxx";
$url="http://example.com/login.php";
$cookie="cookie.txt";
$postdata = "username=".$username."&passwd=".$password;
$postdata = "username=$username&passwd=$password";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt ($ch, CURLOPT_REFERER, $url);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$result = curl_exec ($ch);
echo $result;
curl_close($ch);
?>
你想要什麼? – 2015-03-19 07:26:24
我想登錄該網站並獲取會員區域頁面的html。現在,它只是顯示登錄頁面時,我搶即它不是洛我的 – 2015-03-19 07:27:12
可能重複的內容(http://stackoverflow.com [如何通過由JavaScript即submited沒有在提交表單按鈕PHP的捲曲登錄] /問題/ 24308683 /如何對登錄貫通的PHP捲曲 - 這 - 是 - submited按JavaScript的IE瀏覽器沒有提交對接) – 2015-03-19 07:29:37