자바 스크립트를 사용하여 페이지를 꼬집어 내려고 노력합니다 ... 커뮤니티에 도움을 요청합니다!Curl and javascript submit
<script>
<!--
function vallogin(){
document.formlogin.action = "./index.php?vallogin=1";
document.formlogin.submit();
}
-->
</script>
<form name="formlogin" method="post">
<div class="headerblocgris">
<span class="txtnoir12">| Accès |</span>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="txtnoir12">Login</td>
<td><input name="txtlogin" type="text" size="15" /></td>
<td><span class="txtnoir12">Password</span></td>
<td>
<input name="txtmdp" type="password" size="15" />
<input type="image" name="vallogin" src="images/bt_go.gif" align="absmiddle" />
</td>
</tr>
</table>
</form>
그리고 내 컬 기능 : 여기
양식입니다 귀하의 의견{
/**
* Connexion
*/
$URL = 'http://www.affiliatevista.com/index.php?vallogin=1';
$data = array(
'txtlogin' => $this->login,
'txtmdp' => $this->passe,
'formlogin' => '',
'vallogin' => '',
);
curl_setopt($this->ch, CURLOPT_URL, $URL);
curl_setopt($this->ch, CURLOPT_HEADER, true);
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $this->implode_array($data));
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->_getCookie());
curl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->_getCookie());
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
$String = curl_exec($this->ch);
echo $String;
}
감사합니다, 위의 코드 형태를 확인하지 않습니다, 나는 내가 뭔가를 그리워 생각 유효성 검사 프로세스를 제출하십시오 ...
이 양식은 내 것이 아니라 내가 원하는 사이트에 있습니다. 전자 곱슬 기능 http://www.affiliatevista.com/ 볼 수 있듯이 입력 안에 onclick을 추가하지 않으므로 처리해야하고 컬링 내부의 vallogin을 호출해야합니까? –
@henri 당신은 저를 조금 잃어 버렸습니다. 당신은 PHP에서 자바 스크립트를 실행할 수 없습니다. 하나는 클라이언트 측의 다른 서버 측입니다. 당신은 javascript와 html에 접근 할 수 없다는 것을 의미합니까? 그렇다면 서버에서 submit 함수를 호출하려고합니까? –
그래서 만약 내가 양식 유효성 검사 : javascrip에 의해 유효성 검사 양식을 가진 CURL을 사용할 수 없다는 것을 알고 /index.php?vallogin=1? 감사합니다 논리 단위! –