2012-02-25 12 views
5

मुझे php curl post के साथ एक छोटी सी समस्या है।गैर-अंग्रेजी अक्षरों के साथ PHP कर्ल पोस्ट

मैं कुछ तुर्की पात्रों को एक मंच पर पोस्ट करने की कोशिश कर रहा हूं लेकिन यह पोस्ट नहीं किया गया है कि यह कैसे होना चाहिए।

 

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

और पोस्टिंग:

यह मैं पाठ कैसे को बचाने के है

$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); 

यह है कि यह कैसे किया जाना चाहिए:

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

यह कैसे यह है पोस्ट किया गया है:

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

धन्यवाद

+0

क्या आप स्पैमर हैं? –

+2

स्पैमर? आपको यह निष्कर्ष कैसे मिला? सिर्फ इसलिए कि मैंने एक php समारोह में मदद मांगी? – gtht90

उत्तर

2

ने सुझाव दिया

$message = @iconv("UTF-8","Windows-1252//IGNORE",$message); 
साथ फिक्स्ड 0
1

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

कोशिश जोड़ने:

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

application/x-www-form-urlencoded @spencercw

+0

काम नहीं करता है। मुझे मिलता है "आपका सबमिशन संसाधित नहीं किया जा सका क्योंकि एक सुरक्षा टोकन गुम था।" – gtht90

+1

मुझे लगता है कि आपको 'टेक्स्ट/एक्सएमएल' के बजाय' एप्लिकेशन/एक्स-www-form-urlencoded' की सामग्री प्रकार की आवश्यकता है। – spencercw

+0

क्या आपके '$ post_fields' चर में' securitytoken' प्रविष्टि है? – seanbreeden

संबंधित मुद्दे