http://www.j-love.info/natsu/iphone-app/natsus_note/dev/tips/iphonexcodebuild_and_analyze.html
<?php
$params = array(
“login-name” => ‘nakamuraya’,
“login-password” => ‘gerogero’,
“submit” => “ログイン”
);
$fp = fopen(“tmp”, “w”);
$ch = curl_init(“http://www.phppro.jp/members/login.php”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, “cookie”);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_WRITEHEADER, $fp); $
output = curl_exec($ch);
fclose($fp); curl_close($ch);
print “CURL OUTPUT:n{$output}n”;
$ch = curl_init(“http://www.phppro.jp/members/history.php”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, “cookie”);
curl_setopt($ch, CURLOPT_COOKIEFILE, “tmp”);
curl_setopt($ch, CURLOPT_POST, TRUE);
$output = curl_exec($ch);
print_r(curl_getinfo($ch));
curl_close($ch);
print “CURL OUTPUT:n{$output}n”;
?>
参照元 : http://itpro.nikkeibp.co.jp/article/COLUMN/20070704/276685/
この投稿へのコメント
コメントはまだありません。