TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   curl - help (http://www.talkphp.com/absolute-beginners/3191-curl-help.html)

sarmenhb 07-30-2008 03:36 AM

curl - help
 
im using wamp in php.ini this is what i got

Code:

extension=php_curl.dll
so there is no semicologn in front of that line in php.ini

the code im testing is

Code:

<?php

$ch = curl_init('http://www.google.com'); // the target
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return the page
$result = curl_exec($ch); // executing the cURL
curl_close($ch); // Closing connection
echo $result; 

?>

when i run the page nothing shows on the screen. what am i missing here?

Aaron 07-30-2008 11:33 AM

Try echoing out any value, if that doesn't show up, then add some text above the <?php sign.

Instead of just echoing the result, check to see if it isn't false first. If it is false, have the script notify you.

Ross 07-30-2008 02:59 PM

Like Aaron said echo out a value before the main cURL part. Also use var_dump on $result and $ch.

sarmenhb 08-02-2008 03:52 PM

thanks all, i found out my wamp was messed up for some reason.


All times are GMT. The time now is 07:42 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0