저는 cURL을 처음 사용하기 때문에 귀하의 도움이 필요합니다. 제 상황은 form-site (form.php)를 통해 form (formular.php)을 보내고 싶습니다.PHP curl이 양식의 게시물 데이터를 보내지 않습니다.
form.php는 cURL을 통해 formular.php를 호출합니다.
<?php
error_reporting(-1);
$url = 'http://localhost/formular.php';
$data = array('customerline' => 'nummer1', 'customerphonenumber' => 'nummer2');
$postString = http_build_query($data, '', '&');
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 2);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postString);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$post = curl_exec ($ch);
curl_close ($ch);
echo $post;
?>
formular.php
<?php if(isset($_POST['form'])): ?>
Sent!
<?php else: ?>
<form action="http://localhost/formular.php" method="post" name="form">
<input type="text" name="customerline" />
<input type="text" name="customerphonenumber" />
<input type="submit" value="send" name="form" />
</form>
<?php endif; ?>
내 문제는 방법을 이해하지 않습니다이다 form.php : 여기
은 모두 소스 코드입니다 "Sent!"텍스트 통로를 얻으십시오.
도와 주시겠습니까?
입력에 감사드립니다. 이제 완벽하게 작동합니다. 손 들어 (: –