...

View Full Version : curl not working..url with parameter with commas...



jayminkey
09-08-2011, 05:30 AM
Hi,

i am fetching web page data using curl...and its working fine for

http://www.domainname.com/zip/30012

But when i am trying to fetch url like

/zip/30012/type-single-family-home,condo-townhome-row-home-co-op,mfd-mobile-home/pg-1#/

it doesn't work... showing Bad Request (Invalid URL) and same URL worked with browser

my code is


function fetch_totalproperty($furl)
{
// Set up the CURL object
$ch = curl_init($furl);

// Fake out the User Agent
curl_setopt( $ch, CURLOPT_USERAGENT, "Internet Explorer" );

// Start the output buffering
ob_start();

// Get the HTML from MetaCritic
curl_exec( $ch );
curl_close( $ch );

// Get the contents of the output buffer
$str = ob_get_contents();
ob_end_clean();

return $str;
}

//
// A very simple example that gets a HTTP page.
//

$get_content = fetch_totalproperty("http://www.domainname.com/zip/30012/type-single-family-home,condo-townhome-row-home-co-op,mfd-mobile-home/pg-1#/");


print_r($get_content);

i just hide domain name here......but for http://www.domainname.com/zip/30012 its working fine..

can any one help me in this?

Thanks,
Jaymin



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum