-1
ポストを使ってログインしてクッキーを保存するためのPHPコードを作成することは可能ですか? それからクッキーを使って別の投稿をしますか?私は何も示さないことなく、PHPのコードを希望可能であればログインしてからPOST
は、多分ポスト1 OKエコーポストエコー2 [OK]を、私はこのコードを見つけたが、それは
<?php
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, 'http://xxxxxxxx/login.php');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'username=xxxxxxx&password=xxxxxxxxx&submit=Login');
Curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
$store = Curl_exec ($ch);
curl_setopt ($ch. CURLOPT_URL, 'http://xxxxxx/postlink2.php');
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'info1=xxxxxxx&info2=xxxxxx&info3=xxxxxxxxxx');
$content = curl_exec ($ch);
curl_close ($ch);
?>
私はこのスクリプトをテストしましたが、2番目の要求はdntの作業をテストしました。 – Gorfi