Activity Stream
48,167 MEMBERS
6953 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1.     
    #1
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com

    Default PHP Curl post with non-english characters

    I have a small problem with php curl post.

    I am trying to post some turkish characters to a forum but aren't posted how it should be.

    This is how i save the text:
    PHP Code: 
    fwrite($fpp,"\xEF\xBB\xBF");
    fwrite($fpp$row['template']);
    fclose($fpp); 
    and posting:
    PHP Code: 
    $this->curl curl_init();
    curl_setopt $this->curlCURLOPT_URL$this->vb_url 'newthread.php?' $url_vars );
    curl_setopt $this->curlCURLOPT_POSTtrue );
    curl_setopt $this->curlCURLOPT_POSTFIELDS$post_fields );
    curl_setopt $this->curlCURLOPT_RETURNTRANSFERtrue );
    curl_setopt $this->curlCURLOPT_CONNECTTIMEOUT,20);
    curl_setopt $this->curlCURLOPT_TIMEOUT,10);
    curl_setopt $this->curlCURLOPT_HEADERtrue );
    curl_setopt $this->curlCURLOPT_FOLLOWLOCATION0);
    curl_setopt $this->curlCURLOPT_COOKIE$this->cookie_name );
    curl_setopt $this->curlCURLOPT_COOKIEJAR$this->cookie_name );
    curl_setopt $this->curlCURLOPT_COOKIEFILE$this->cookie_name );
    curl_setopt $this->curlCURLOPT_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 ); 
    this is how it should be:
    Code: 
    B?l?m resimleri, dizi indirme ve altyazı linkine aşağıdan ulaşabilirsiniz.
    this is how it is posted:
    Code: 
    Bölüm resimleri, dizi indirme ve altyaz? linkine a?a??dan ula?abilirsiniz.
    Thanks
    t3od0r Reviewed by t3od0r on . PHP Curl post with non-english characters I have a small problem with php curl post. I am trying to post some turkish characters to a forum but aren't posted how it should be. This is how i save the text: fwrite($fpp,"\xEF\xBB\xBF"); fwrite($fpp, $row); fclose($fpp); and posting: Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    I'm not quite sure but maybe setting CURLOPT_ENCODING could help.

  4.     
    #3
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    ok it seems you need to get the content type to post as UTF-8.

    try:
    Code: 
    curl_setopt($this->curl, CURLOPT_HTTPHEADER , array(
         'Content-Type: application/x-www-form-urlencoded; charset=utf-8',
    ));
    *after* setting CURLOPT_POST and CURLOPT_POSTFIELDS.
    Projects:
    WCDDL - The Professional DDL Script
    Top Secret Project: In Development - ZOMG
    ImgTrack - Never Have Dead Images Again!

  5.     
    #4
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    If i use that i get
    "Your submission could not be processed because a security token was missing"

  6.     
    #5
    Member
    Website's:
    sborg.us
    ^^ Ding dong. You need to store the session ID and pass it as a parameter while making that request.

    V3g3ta | Halcyon | Abhi

  7.     
    #6
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    i already do that, but if am using the httpheader i get that error, if i don't use it the script is posting.

    PHP Code: 
    $url_vars $this->array_to_http(array(
                
    'do'    => 'newthread',
                
    'f'        => $forum_id,
            ));
                    
    $this->curl curl_init();
    curl_setopt($this->curl,CURLOPT_URL$this->phpbb_url 'newthread.php?' $url_vars );
    curl_setopt($this->curl,CURLOPT_RETURNTRANSFERtrue);
    curl_setopt($this->curl,CURLOPT_CONNECTTIMEOUT,"10");
    curl_setopt($this->curl,CURLOPT_TIMEOUT,"10");
    curl_setopt($this->curlCURLOPT_HEADERfalse );
    curl_setopt($this->curl,CURLOPT_COOKIEFILE,$this->cookie_name );
    $pcurl_exec($this->curl);
    $error=curl_error($this->curl);
    curl_close($this->curl);

    preg_match('%name="securitytoken" value="(.*?)" />%',$p,$security123);
    // Generate post string
            
    $post_fields = array(
                
    'sbutton'                => 'Submit New Thread',
                
    'do'                => 'postthread',
                
    'message'            => $message,
                
    'f'                    => $forum_id,
                
    'securitytoken' => $security123[1],
                
    'subject'            => $topic_title,
                
    'loggedinuser'      => '1',
                
    'wysiwyg'            => 0,
                
    'prefixid'            => '',
                
            );
            
    $url_vars = array(
                
    'do'    => 'postthread',
                
    'f'        => $forum_id,
            );
            
    //printr($post_fields);
            // Init curl
            
    $this->curl curl_init();
            
    // Set options
            
    curl_setopt $this->curlCURLOPT_URL$this->phpbb_url 'newthread.php?' $url_vars );
            
    curl_setopt $this->curlCURLOPT_POSTtrue );
            
    curl_setopt $this->curlCURLOPT_POSTFIELDS$post_fields );
            
    curl_setopt $this->curlCURLOPT_RETURNTRANSFERtrue );
            
    curl_setopt $this->curlCURLOPT_CONNECTTIMEOUT,20);
            
    curl_setopt $this->curlCURLOPT_TIMEOUT,10);
            
    curl_setopt $this->curlCURLOPT_HEADERtrue );
            
    curl_setopt $this->curlCURLOPT_FOLLOWLOCATION1);
            
    curl_setopt $this->curlCURLOPT_COOKIE$this->cookie_name );
            
    curl_setopt $this->curlCURLOPT_COOKIEJAR$this->cookie_name );
            
    curl_setopt $this->curlCURLOPT_COOKIEFILE$this->cookie_name );
            
    curl_setopt $this->curlCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1'); 

  8.     
    #7
    Member
    Website's:
    PasteBot.appspot.com
    curl_setopt( $ch, CURLOPT_ENCODING, "UTF-8" );

    http://www.sitepoint.com/forums/show...TF8-supporting

  9.     
    #8
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    the same
    Bölüm resimleri, dizi indirme ve altyaz? linkine a?Ÿa?Ÿ?dan ula?Ÿabilirsiniz.

  10.     
    #9
    Respected Developer
    try this

    PHP Code: 
    $message iconv("UTF-8","Windows-1252//IGNORE",$message); 
    are you scraping turkish characters?
    Bots Development | Web Development | Wordpress Customization | PSD Conversion

    Life has many twists and turns in it, you have to take what you are given and use it for the best.

  11.     
    #10
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    The text is ok now
    The only problem is that i get a notice
    Code: 
    Notice: iconv() [function.iconv]: Detected an illegal character in input string in
    but is working

    i read the rext from a txt file which i save it like this
    Code: 
    $fh = fopen($file,'wb');
    fwrite($fh,"\xEF\xBB\xBF");
    fwrite($fh,$ppost);
    fclose($fh);

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Selling] High quality articles and English-German-English translation
    By Lendar in forum Services
    Replies: 5
    Last Post: 5th Jul 2012, 02:01 PM
  2. Where to post videobb links [need english sites]
    By Rapid S in forum File Host Discussion
    Replies: 0
    Last Post: 6th Jan 2012, 06:14 AM
  3. Replies: 15
    Last Post: 20th Dec 2011, 03:30 AM
  4. Php replacing characters !
    By softleaks in forum Web Development Area
    Replies: 8
    Last Post: 30th May 2011, 02:42 PM
  5. Japanese Characters for Wi-Fi
    By bxflow in forum General Discussion
    Replies: 5
    Last Post: 12th Jan 2011, 01:23 AM

Tags for this Thread

BE SOCIAL