Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2006-10-03, 07:48 AM   #1
Xallow
Hello, is this President Clinton? Good! I figured if anyone knew where to get some tang it would be you
 
Join Date: May 2006
Location: Denmark
Posts: 447
Send a message via ICQ to Xallow
cURL

Hi guys and gals

Apparently my host uses cURL, I dont have a clue how to use this and I really need to use it for some xml feeds, I would be deeply in your debt if You could help me... I need file you can download here to work with it... dont worry.. its not a virus or trojan or anything, I like being at GG&J and wouldn't want to be banned.

http://www.netcamperformers.com/perflister.zip

satan tried to explain it to me in another thread and I looked it up in some php books but the books I have said nothing of cURL.

Thanks for Your help

Xallow
__________________
Porn Safe Submit Free Sites
Porn Party Porn Submit Free Sites
Xallow is offline   Reply With Quote
Old 2006-10-03, 07:59 AM   #2
kitty_kate
Well you know boys, a nuclear reactor is a lot like women. You just have to read the manual and press the right button
 
kitty_kate's Avatar
 
Join Date: Jun 2006
Location: The Colloseum
Posts: 155
Send a message via ICQ to kitty_kate
In your script, I see at the line number 36 this:
PHP Code:
$xml_content file_get_contents$xml_source 
Here is where you have to make the change.

Add this function to your script, at the beggining of it, right after the <?php tag line:

PHP Code:
/**
  * Retrieves the url
  *
  * @param string $url
  * @param string $uagent
  * @return string
  */
 
function retrieveUrl($url) {
     
// create a new CURL resource
     
$ch curl_init();
     
// set URL and other appropriate options
     
curl_setopt($chCURLOPT_URL$url);
     
curl_setopt($chCURLOPT_HEADERtrue);
     
curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
     
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
     
// grab URL and pass it to the browser
     
$result curl_exec($ch);
     
// close CURL resource, and free up system resources
     
curl_close($ch);     
     return 
$result;
 } 
Then change your code at the 36th line into:
PHP Code:
$xml_content retrieveUrl$xml_source 
I didn't tested it 'cause I'm on the run, but it should work.
__________________
My Asian Kitty - My Free Sites
kitty_kate is offline   Reply With Quote
Old 2006-10-03, 08:23 AM   #3
Xallow
Hello, is this President Clinton? Good! I figured if anyone knew where to get some tang it would be you
 
Join Date: May 2006
Location: Denmark
Posts: 447
Send a message via ICQ to Xallow
That took care of the error, but it still doesnt show the content
__________________
Porn Safe Submit Free Sites
Porn Party Porn Submit Free Sites
Xallow is offline   Reply With Quote
Old 2006-10-03, 09:41 AM   #4
kitty_kate
Well you know boys, a nuclear reactor is a lot like women. You just have to read the manual and press the right button
 
kitty_kate's Avatar
 
Join Date: Jun 2006
Location: The Colloseum
Posts: 155
Send a message via ICQ to kitty_kate
Hang on there, I'm looking into it right now
__________________
My Asian Kitty - My Free Sites
kitty_kate is offline   Reply With Quote
Old 2006-10-03, 09:51 AM   #5
kitty_kate
Well you know boys, a nuclear reactor is a lot like women. You just have to read the manual and press the right button
 
kitty_kate's Avatar
 
Join Date: Jun 2006
Location: The Colloseum
Posts: 155
Send a message via ICQ to kitty_kate
Ok, my bad. My function is returning the HTTP headers with the content, and that was making the XML parser to give an error. You have to return to the function I gave you and change a parameter inside it.

PHP Code:
curl_setopt($chCURLOPT_HEADERtrue); 
must become

PHP Code:
curl_setopt($chCURLOPT_HEADERfalse); 
This way it will work.
__________________
My Asian Kitty - My Free Sites
kitty_kate is offline   Reply With Quote
Old 2006-10-03, 10:27 AM   #6
Xallow
Hello, is this President Clinton? Good! I figured if anyone knew where to get some tang it would be you
 
Join Date: May 2006
Location: Denmark
Posts: 447
Send a message via ICQ to Xallow
That did it, thanks a bunch Kitty Kate
__________________
Porn Safe Submit Free Sites
Porn Party Porn Submit Free Sites
Xallow is offline   Reply With Quote
Old 2006-10-03, 10:51 AM   #7
kitty_kate
Well you know boys, a nuclear reactor is a lot like women. You just have to read the manual and press the right button
 
kitty_kate's Avatar
 
Join Date: Jun 2006
Location: The Colloseum
Posts: 155
Send a message via ICQ to kitty_kate
No problem, tiger. Glad I could help you
__________________
My Asian Kitty - My Free Sites
kitty_kate is offline   Reply With Quote
Reply


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


All times are GMT -4. The time now is 03:59 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc