PHP cURL

  • ilyawizard
  • Proficient
  • Proficient
  • No Avatar
  • Joined: Oct 24, 2004
  • Posts: 413
  • Status: Offline

Post December 18th, 2007, 7:35 am

Hello,

I'm trying to get the feed through cURL function because my hosting disabled fopen function and I can't use simplexml_load_file now. When I use cURL with this feed it gives me BAD REQUEST back, however if I use regular page then it parses it correctly. Here's the code I'm using:

$ch = curl_init();
$fp = "xml_link.asp?somequeryvariables";
curl_setopt($ch, CURLOPT_URL, $fp);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$result=curl_exec($ch);
curl_close($ch);
echo $result;

Any suggestions? I'm new to cURL, and only spent a few hours with it, but couldn't find much info about xml and cURL. Thanks in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post December 18th, 2007, 7:35 am

Post December 28th, 2007, 1:30 pm

use hosting that can running in safe mode or open base dir, maybe

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 111 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.