Hi there - im using curl, to extract details of a web-page...

HOWEVER - Sometimes the (valid / correct) HTML output retrieved - is
blank / No value...

Ie it only retrieves information - ifit exists (of course)...

EG - on yahoogroups - Pending members (download page).... - If you
have no pending members - there will be  no output....

CURRENTLY - i have 

$result = curl_exec ($ch));

and then saving the resuts to a file...  - I'm thinking - of changing
it to below :-

im just wondering - If there are no pending members - there would be
no preg-match with \w etc...

ive uploaded the following - & think the below code will work -  Just
checking / confirming here....

Will the below code work :- 


$g=0;
$cookie_file_path="/mypath/mypath";
    curl_setopt($ch, CURLOPT_URL,$LOGINURL);
        curl_setopt($ch, CURLOPT_USERAGENT, $agent);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
        curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
if( $result = curl_exec ($ch)){$g=1;}
    curl_close ($ch);
echo "$LOGINURL\n<PRE>
</PRE>\n";


if(g>0){
$file11= "/mypath/myfile.txt";
$handle = fopen($file11, "w");
fwrite($handle, "$result\n");
fclose ($handle);
}


======================



-- 
G Stewart
http://e-services.kwister.com/
NZ community groups - [EMAIL PROTECTED]


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to