Hi all,
I'm very new to php - so please be patient with me.
I'm having a problem using curl. If this is not the right place to post about this perhaps someone could point me in the right direction.
I want to offer my client an alternative to iframes. I came across curl which seems that it would do the trick. Problem is, the site i'm trying to pull the info from keeps telling me that I need to be able to accept cookies. I've tried looking everywhere to figure out a solution, but I really don't know what to do.
Below is what I have. The URL has obviously been changed. Am I using it wrong?
<?php
$usecookie = "cookie.txt";
$ch = curl_init() or die(curl_error());
curl_setopt($ch, CURLOPT_URL,"http://www.example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $usecookie);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, $usecookie);
$data1=curl_exec($ch) or die(curl_error());
echo "<font color=black face=verdana size=3>".$data1."</font>";
echo curl_error($ch);
curl_close($ch);
?>