cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: (bump) No MySQL data in cURL output

From: <perquin_at_yuplounge.nl>
Date: Tue, 22 Aug 2006 16:34:47 -0400

This one does work:
<?php
$url= "http://www.vcclite.com/vccpmp3/conxritedwg.php";
        $ch = curl_init(); // create cURL handle (ch)
// $content = curl_setopt($ch, CURLOPT_TIMEOUT, 130);
        $content = curl_setopt($ch, CURLOPT_URL, $url);
        $content = curl_exec($ch);
        curl_close($ch); // close cURL handler
echo $content;
?>

On Tue, 22 Aug 2006 09:28:35 -0700 (PDT)
  Tex McKloud <texmckloud_at_yahoo.com> wrote:
> Doesn't anyone want to tackle this?
>
> I have read many posts here and on php.net (I'd post
> there, but their mail server doesn't work)
> I cannot do a capture (Web page scraping?) from my
> php/mysql generated web page.
>
> The webpage, conxritedwg.php, reads data from a mysql
> database (on a different domain, btw), then generates
> a the output.
>
> The only content I can capture is my header and footer
> (all static information). No data from the database.
> I've tried many curl_setopt configurations, but to no
> avail.
>
> I simply want to capture the exact content that the
> client sees and save it to the server.
>
> Here is the latest code I've tried (cobbled together
> from several sources here and php.net):
>
> // Function to grab the screen
>
> function GrabURL($ID) {
>
> $doc_root = $_SERVER['DOCUMENT_ROOT'];
> $curl_handle=curl_init();
> $fp = fopen("$doc_root/vccpmp3/dwgs/dwg$ID.html",
> "w");
> curl_setopt($curl_handle,CURLOPT_URL,"http://www.vcclite.com/vccpmp3/conxritedwg.php");
> // curl_setopt($curl_handle,CURLOPT_VERBOSE, 1);
> // curl_setopt($curl_handle,CURLOPT_HEADER, 1);
> curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,60);
> curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
> curl_setopt($curl_handle,CURLOPT_FOLLOWLOCATION,1);
> curl_setopt($curl_handle, CURLOPT_COOKIEJAR,
> "$doc_root/vccpmp3/cookies$ID.txt");
> curl_setopt($curl_handle, CURLOPT_COOKIEFILE,
> "$doc_root/vccpmp3/cookies$ID.txt");
> $buffer = curl_exec($curl_handle);
>
> if (empty($buffer))
> {
> print "<p>Sorry, vcclite.com is not
> responding.</p>";
> }
> else
> {
> fwrite($fp, $buffer);
> // print $buffer;
> }
>
> curl_close($curl_handle);
> fclose($fp);
> }
>
>
> In order to see the COMPLETE output, you must step
> through the 'Configurator' beginning here:
> http://www.vcclite.com/vccpmp3/
>
> Configure a single LED cable, then generate the
> drawing. WHen you click 'Complete RFQ' that is when
> the grabber.php comes into play. The output URL will
> be found in the form. Check it out for yourself.
>
> Any takers?
>
> Regards;
>
> Tex McKloud
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection
>around
> http://mail.yahoo.com
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Yuplounge
Nr1 in Zoekmachineoptimalisatie en websitepromotie.
Jan van Brakelplantsoen 4
2253 TD Voorschoten
perquin_at_yuplounge.nl
www.yuplounge.nl
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-08-22