예 cron 작업 예제에서 컬 세트를 올바르게 사용했다고 들었습니다. 컬 방문 http://php.net/manual/en/book.curl.php에와 크론 작업의 대부분의 호스트가 XD를 사용할 준비가 크론 기능을 제공하기위한 추가 정보를 위해
//The data
$data = array(
"fname" => "Mark",
"lname" => "Jones",
"Bio" => "Hi i like rose's because they smell nice",
"website" => "http://mysite.com",
"email" => "[email protected]",
"password" => "mypassword",
"token" => "your token",
"Agent" => "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5"
);
//External site direct link
$external_site = "http://external-site.com";
//Input field names with data ready
$input_fields = "fname=".$data['fname']."&lname=".$data['lname']."&Bio=".$data['bio']."&website=".$data['website']."&email=".$data['email']."&password=".$data['password']."&Cpassword=".$data['password']."&token=".$data['token']."&submit=";
//Do the curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL , $external_site);
curl_setopt($ch, CURLOPT_USERAGENT, $data['Agent']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $input_fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$done = curl_exec ($ch);
curl_close($ch);
.
'자동화 된 작업 '은'cron'을 통해 수행됩니다. curl 사용하지 않음 –
사실, 귀하의 질문은 _php 특정 _이 아닙니다. http를 통해 변수를 전달하려면 ['query string'] (http://en.wikipedia.org/wiki/Query_string)을 사용해야합니다. – Leri