Hi,
Well, with help, I managed to sort out my scraping problems ... got another problem now though.
Trying to use curl to log into racingpost.com so I can scrape info only available to those who sign in.
I'm blagging it a bit though as the form submits seem to be done in javascript and I think I've got the correct post url but not sure. And, of course, I'm useless with curl!

Any help greatly appreciated.
Here's my code:
<?php
# Go to site home page - just in case cookies are set
$ref="www.racingpost.com";
$target="http://www.racingpost.com";
$post_data="";
$x=Curlit($target,$post_data,$ref);
#Set up login data
$post_data="in_un=wellyfish&in_pw=wellyfish99&process=IN&logInType=lightbox&PARGS=&protoSecure=0"; #post parms
$target="https://reg.racingpost.com/modal_dialog/login.sd?protoSecure=0"; #login url
$login=Curlit($target, $post_data, $ref); #try to login
# Re-scrape home page to see if logged in successfully
$target="http://www.racingpost.com";
$html="";
$post_data="";
$x=Curlit($target,$post_data,$ref);
print_r($x);
function Curlit($rpcurl,$request, $ref)
{
$cookie = "cookies.txt";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_URL, $rpcurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt ($ch, CURLOPT_REFERER, $ref);
$html=curl_exec($ch);
curl_close($ch);
return $html;
}
also, I'm runnig the script from my pc and I can't find the cookies.txt file anywhere
