外部サイトで自動化されたジョブを実行しようとしています。curl を使用する必要があると言われたので、curl を使用できるかどうかを尋ねているのでしょうか? そして、これらの入力フィールドでそれを行うにはどうすればよいですか:
name="fname"
name="lname"
name="bio"
name="website"
name="email"
name="password"
name="Cpassword"
name="token"
name="submit"
はい、cronジョブの例でcurlsetを使用して正しく通知されました。
//The data
$data = array(
"fname" => "Mark",
"lname" => "Jones",
"Bio" => "Hi i like rose's because they smell nice",
"website" => "http://mysite.com",
"email" => "mark@mysite.com",
"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);
curlの詳細については、http://php.net/manual/en/book.curl.phpにアクセスしてください。また、cronジョブのほとんどのホストは、XDを使用するためのすぐに使用できるcron機能を提供しています。