Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 23rd, 2007, 10:06 PM   #1
jacobb
Newbie
 
Join Date: Dec 2007
Posts: 1
Rep Power: 0 jacobb is on a distinguished road
cURL issue weird characters

I am writing a program that will send out invitations to social networking sites I am using curl to connect and get info. On all the sites curl works but on tagged.com it throws me ASCII characters instead of the website. It's like it is encrypted or something.


Here is my code nothing out of the ordinary:


$file_path = '/tmp/cookies.txt';
$ch = curl_init();
curl_getinfo($ch);
curl_setopt($ch, 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");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,"http://www.tagged.com);
curl_setopt($ch, CURLOPT_COOKIEJAR, $file_path);
$page = curl_exec($ch);
curl_close($ch)
echo $page;


any ideas of why this is happening?
jacobb is offline   Reply With Quote
Old Dec 24th, 2007, 12:45 AM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
Re: cURL issue weird characters

I've never used cURL before, but one of the HTTP header attributes specifies whether or not the response should be compressed or not. This is specified in the "Accept-Encoding" parameter, and maybe since you don't seem to be specifying that, tagged.com assumes a default of compression, whereas most sites will default to no compression.

See section 14.3 in the rfc2616 standard for more information on "Accept-Encoding". Then you could look into how to specify no compression with cURL.

Disclaimer: This might be a total waste of your time, because I've never used cURL and it could be a very different problem. This is just something you could try if you really want to get this resolved asap.
Sane is offline   Reply With Quote
Old Dec 26th, 2007, 10:11 AM   #3
null_ptr0
11 years old
 
Join Date: Nov 2007
Posts: 79
Rep Power: 1 null_ptr0 is on a distinguished road
Re: cURL issue weird characters

ord() and substr()
__________________
iload_0 iconst_1 ishl or
iload_0 iconst_2 idiv or
iload_0 iconst_2 iconst_1 imul idiv
[1] & [2] use the smallest stack size
null_ptr0 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Regular Expression: Matching All Possible Characters kruptof PHP 3 May 30th, 2007 6:22 PM
2 dimension array of characters brad sue C 8 Mar 15th, 2006 9:40 AM
Converting ANSI characters to hex for Checksum. JawaKing00 C 4 Sep 9th, 2005 5:07 AM
For loops, a lot, outputting weird characters layer C++ 11 May 12th, 2005 8:09 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:35 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC