<?
function baglan($url,$ref = 'http://www.wordpressite.com/')
{
$username="wpkullanıcıadı";
$password="wpsifreniz";
$cookie=dirname(__FILE__).'/cookies.txt';
$postdata = "log=". $username ."&pwd=". $password ."&wp-submit=Log%20In&redirect_to=". $url ."wp-admin/&testcookie=1";
$postdatam = "post_title=basligim&content=aciklamam&tags_input=etim&action=post-quickpress-publish&post_type=post&_wp_http_referer=". $url ."/wp-admin/index.php";
//$postdatam = "post_title=basligim&content=aciklamam&tags_input=etim&action=post-quickpress-publish&post_ID=795&post_type=post&_wpnonce=971f24eede&_wp_http_referer=". $url ."wp-admin/";
//$postdata1 = "log=". $username ."&pwd=". $password ."&wp-submit=Giri%C5%9F&redirect_to=". $url ."wp-admin/post-new.php/&testcookie=1";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url . "wp-login.php");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie);
curl_setopt($ch,CURLOPT_COOKIEFILE,$cookie);
curl_setopt ($ch, CURLOPT_REFERER, $url . "wp-admin");
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdatam);
//curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata1);
curl_setopt ($ch, CURLOPT_POST, 1);
$konu_ici=curl_exec($ch);
curl_close($ch);
return $konu_ici;
}
$adres1 = "http://www.wordpressite.com/";
$baglan1 = baglan($adres1);
echo $baglan1;
?> PhP Curl Kodu Acil Yardım Lütfen
4
●808
- 20-02-2013, 23:48:19Yapmak istediğim ilk önce wordpres blog sitesine giriş yapsın , daha sonra yeni yazı kısmından yazı eklesin.Ama Bir türlü beceremedim.Bunu beceremediğim için aşağıda da görüldüğü gibi wp-admin başlangıç sayfasındaki QuickPress e ekleyeyim dedim ama yine olmadı nerede yanlış yapıyorum acaba ?
- 21-02-2013, 20:44:50Wordpresin kendi kayıt fonskiyonu var bunun için admin panele bağlanmanıza gerek yok wp_insert_post işinizi görecektir