Arkadaşlar sorunumu anlatayım kısaca ;

Amacım Curl ile vbulletin'e giriş yapıp , konu açmak .

Fakat yaşadığım problem biraz değişik , curl 'u ilk çalıştırdığımda vbulletine konu açamıyorum hata olarak:

Your submission could not be processed because you have logged in since the previous page was loaded.

Please push the back button and reload the previous window.


Bu gördüğünüz hata mesajını alıyorum , googleda araştırdım vbulletin crsf önlemiymiş.

Ve curl 'u ikinci defa çalıştırdığımda sorunsuz olarak karşı tarafa konuyu atıyor..

İlkinde neden atmıyor ve hata mesajı alıyorum çözemedim tam olarak , ama dediğim gibi 2. çalıştırışımda konuları atabiliyorum..

Ama cookieleri silersem gene ilk çalıştırışımda atamıyorum 2. çalıştırışımda atıyorum , olay cookielerlemi ilgili vbulletinin securitytoken olarak verdiği güvenlik koduylamı ilgili tam anlayamadım , yardımcı olursanız sevinirim..

Kullandığım kodlarda aşağıda gözüktüğü gibidir , yardımlarınızı bekliyorum ..
<?php
  $user="x";
  $pass="x";
  $url="http://www.xxxx/";
  $threadf="xxx";

  
  $ch = curl_init();
  curl_setopt($ch , CURLOPT_URL , $url);
  curl_setopt($ch , CURLOPT_RETURNTRANSFER , TRUE);
  curl_setopt($ch , CURLOPT_FOLLOWLOCATION , TRUE);
  curl_setopt($ch , CURLOPT_REFERER , "http://www.google.com");
  curl_setopt($ch , CURLOPT_USERAGENT , $_SERVER['HTTP_USERAGENT']);
  curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
  curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');
  $data=curl_exec($ch);
  
  preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
  curl_setopt($ch , CURLOPT_URL, "".$url."login.php?do=login");
  curl_setopt($ch , CURLOPT_POST , TRUE);
  curl_setopt($ch , CURLOPT_POSTFIELDS, 'cookieuser=1&vb_login_username='.$user.'&vb_login_password='.$pass.'&s=&securitytoken='.$securitytoken[1].'&do=login');
  $data2=curl_exec($ch);  
  
  $subject="selam selam";                
  $message="merhaba merhaba merhaba";
  curl_setopt($ch , CURLOPT_URL , "".$url."newthread.php?do=newthread&f=".$threadf."");
  preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
  curl_setopt($ch , CURLOPT_POST , TRUE);
  curl_setopt($ch , CURLOPT_POSTFIELDS, 'subject='.$subject.'&message='.$message.'&s=&f='.$threadf.'&securitytoken='.$securitytoken[1].'&do=postthread');
  $data3=curl_exec($ch);
  echo $data3;

?>