2012-02-25 13 views
5

Mam mały problem z postem curl php.Post PHP Curl ze znakami innymi niż angielski

Próbuję opublikować niektóre tureckie postacie na forum, ale nie zostały one opublikowane, jak powinno być.

ten sposób zapisać tekst:

 

    fwrite($fpp,"\xEF\xBB\xBF"); 
    fwrite($fpp, $row['template']); 
    fclose($fpp); 

i publikacji:

$this->curl = curl_init(); 
    curl_setopt ($this->curl, CURLOPT_URL, $this->vb_url . 'newthread.php?' . $url_vars); 
    curl_setopt ($this->curl, CURLOPT_POST, true); 
    curl_setopt ($this->curl, CURLOPT_POSTFIELDS, $post_fields); 
    curl_setopt ($this->curl, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt ($this->curl, CURLOPT_CONNECTTIMEOUT,20); 
    curl_setopt ($this->curl, CURLOPT_TIMEOUT,10); 
    curl_setopt ($this->curl, CURLOPT_HEADER, true); 
    curl_setopt ($this->curl, CURLOPT_FOLLOWLOCATION, 0); 
    curl_setopt ($this->curl, CURLOPT_COOKIE, $this->cookie_name); 
    curl_setopt ($this->curl, CURLOPT_COOKIEJAR, $this->cookie_name); 
    curl_setopt ($this->curl, CURLOPT_COOKIEFILE, $this->cookie_name); 
    curl_setopt ($this->curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1'); 
    $result = curl_exec ($this->curl); 

to jak powinno być:

`Bölüm resimleri, dizi indirme ve altyazı linkine aşağıdan ulaşabilirsiniz.`

Jak to jest opublikowane:

`Bölüm resimleri, dizi indirme ve altyazı linkine aşağıdan ulaşabilirsiniz.`

Dzięki

+0

Czy jesteś spamerem? –

+2

Spamer? jak doszedłeś do takiego wniosku? tylko dlatego, że poprosiłem o pomoc w funkcji php? – gtht90

Odpowiedz

2

Usunięto z

$message = @iconv("UTF-8","Windows-1252//IGNORE",$message); 
1

Od http://php.net/manual/es/function.curl-setopt.php

spróbuj dodać:

curl_setopt($this->curl,CURLOPT_HTTPHEADER,array (
    "Content-Type: application/x-www-form-urlencoded; charset=utf-8" 
)); 

application/x-www-form-urlencoded je przez @spencercw

+0

nie działa. Otrzymuję "Twoje zgłoszenie nie może zostać przetworzone, ponieważ zabrakło tokena bezpieczeństwa." – gtht90

+1

Zgaduję, że potrzebujesz typu zawartości 'application/x-www-form-urlencoded' zamiast' text/xml'. – spencercw

+0

Czy twoja zmienna '$ post_fields' zawiera wpis' securitytoken'? – seanbreeden

Powiązane problemy