Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Apr 2009
    Location
    Ahmedabad,India
    Posts
    54
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question curl not working..url with parameter with commas...

    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

    PHP Code:
    function fetch_totalproperty($furl)
    {
        
    // Set up the CURL object
        
    $ch curl_init($furl);
        
        
    // Fake out the User Agent
        
    curl_setopt$chCURLOPT_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
    Last edited by jayminkey; 09-08-2011 at 05:42 AM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •