PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 14th, 2011, 11:57 AM
AD5XJ AD5XJ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2011
Posts: 3 AD5XJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 m 37 sec
Reputation Power: 0
CURL returns cryptic message

OK here is the problem:

I have created a simple test method to get an arbitrary external page using cURL. The code "seems" to work in that it does not return an error as such, just a cryptic message "Some error occured". That is absolutely no help.

Here is the code:
Code:
Code:

<?php 
include('jAPI-CORE.php');


// class to get text of external page

class GetHtml
{

    public function getPage() 
    {
        curl_init("http://www.swpc.noaa.gov/ftpdir/latest/wwv.txt");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        if (curl_exec($ch) === false) 
        {
            return "Error: " + curl_error($ch) + "<br />\n";
        }        

        else 
        {
            return curl_multi_getcontent($ch);
        }
    }

}

//Create new instance of jAPIBaseClass with names 
//of all classes that you want to use them separeted with comma...

new jAPIBaseClass('GetHtml');
?>


Does anyone have an idea what is happening? Why the cryptic message from cURL?

Note: the jAPI interface just lets me reference the function in javascript.
It works fine.

=== UPDATE 15 Sept 2011 =====
Although it is not my default browser and I only use it for compatibility checking, Google Chrome has a debugging console that is useful. Running this script in the debug console supplies a result that says the script is described as javascript but is returned as html. This info is not provided by cURL or the FireFox error console. Any ideas anyone.

the HTML calling it is <script type="text/javascript">GetHTTP.getPage();</script?>

Changing the text type to HTML does not change the error.

Last edited by AD5XJ : September 15th, 2011 at 06:09 PM. Reason: UPDATE

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > CURL returns cryptic message


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap