Kodları lütfen aşağıdaki butonları kullanarak renklendirin. Örnek: <php> echo "Selam Dünya"; </php>
Yardım
karakter kaldı

SMF 2 Foruma Curl ile Konu açmadaki Problem ..

///--- SMF_2 Baslangıc ---///
				function smf_2($url,$user,$pass,$board_id,$baslik,$mesaj){
				$ch = curl_init();
                curl_setopt($ch ,CURLOPT_HEADER,0);    
                curl_setopt($ch ,CURLOPT_RETURNTRANSFER,1);
				curl_setopt($ch ,CURLOPT_FOLLOWLOCATION,1);
				curl_setopt($ch ,CURLOPT_TIMEOUT,300);
				curl_setopt($ch ,CURLOPT_AUTOREFERER, true);
				curl_setopt($ch ,CURLOPT_REFERER , "http://www.google.com/");
                curl_setopt($ch ,CURLOPT_URL,$url."index.php?action=login2");
                curl_setopt($ch ,CURLOPT_USERAGENT ,$_SERVER['HTTP_USERAGENT']);                
                curl_setopt($ch ,CURLOPT_POST,1);
                curl_setopt($ch ,CURLOPT_POSTFIELDS, "user=".$user."&passwrd=".$pass."&cookieneverexp=on&submit=login");
				curl_setopt($ch ,CURLOPT_COOKIEFILE, dirname(__FILE__).'/smfcerez.txt');
                curl_setopt($ch ,CURLOPT_COOKIEJAR, dirname(__FILE__).'/smfcerez.txt');
                $this12 = curl_exec($ch);
                curl_setopt($ch ,CURLOPT_URL,$url."index.php?action=post;board=".$board_id);
                $this12 = curl_exec($ch);
					preg_match('/name="num_replies" value="(.*?)"/',$this12,$num_replies);
					 $replies = $num_replies[1];
					 preg_match('/name="additional_options" value="(.*?)"/',$this12,$additional_options);
					 $additional = $additional_options[1];
					 preg_match('/name="sc" value="(.*?)"/',$this12,$sc1);
					 $sc = $sc1[1];
					 preg_match('/name="seqnum" value="(.*?)"/',$this12,$seqnum1);
					 $seqnum = $seqnum1[1];
					 preg_match('/var current_board = (.*?);/',$this12,$board1);
					 $board = $board1[1];
					 preg_match('/name="subject" value="(.*?)"/',$this12,$subject1);
					 $subject = $subject1[1];
					 preg_match("/sSessionVar: '(.*?)'/",$this12,$sSessionVar1);
					 $sSessionVar = $sSessionVar1[1];
					 preg_match("/sSessionId: '(.*?)'/",$this12,$sSessionId1);
					 $sSessionId = $sSessionId1[1];
				curl_setopt($ch,CURLOPT_URL,$url."index.php?action=post2;start=0;board=".$board_id);
               	curl_setopt($ch,CURLOPT_POST,TRUE);
				curl_setopt($ch,CURLOPT_POSTFIELDS,"topic=0&subject=".$baslik."&post=&icon=Not¬ify=&lock=&move=&attachment[]=&message_mode=0&message=".$mesaj."&additional_options=".$additional."&sc=".$sc."&seqnum=".$seqnum."&num_replies=".$replies."".$sSessionVar."".$sSessionId);
				//
				curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/smfcerez.txt');
				 curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/smfcerez.txt');    
					echo curl_exec($ch);
				}
					///--- SMF_2 BİTİS ---///


yukaridaki problem smf 2.0 forumlara yolluyorum oturumunuz süresi bitti lütfen tekrar oturum açın diyor sorun ne olabilir smf 1 forumlarda çalışıyor.
+0
-0
Cevaba KatılıyorumKatılmıyorum
Cevap Yaz Yorum Yaz Arşivime Ekle Takip Et

Cevaplar

Hiç cevap bulunamadı. İlk cevabı siz yazın.