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

curl-and-php

Access Denied - Help Needed!!

From: Matt Switzer <mattswitzer_at_gmail.com>
Date: Mon, 26 Jun 2006 16:13:15 -0400

Hey!
I am new to cURL and having some touble getting a page returned. All I am
getting is some Java Script and an "Access Denied" error. Below is the cURL
request I am sending off:

$URLVar = 'http://www.mls.ca/PropertyResults.aspx?ci=Toronto&st=90+Sumach';
curl_setopt($ch, CURLOPT_URL, $URLVar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, "CookieHeaders.txt");
curl_setopt($ch, CURLOPT_COOKIEJAR, "CookieHeaders.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$curlresult=curl_exec ($ch);

Below is what I am getting back. It seems to be some stats tracking java
script followed by "Access Denied". As you can see above, I have tried
sending header info, cookies, etc. but no luck. Is there anything I am
missing?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><body site="1">
<!-- ** Start of DeepMetrix (.NET) StatScript -->
<script language='javascript' type='text/javascript'>var DMNETdomain = "";
var DMNETpage = window.location;
var DMNETversion = "86";
var DMNETsendTo = "//stats.crea.ca/dm.gif?";
var DMNETsession;

function dmneterr(){return true;}

window.onerror=dmneterr;
var s = new Date();

if (navigator.userAgent.indexOf('Mac') >= 0 && s.getTimezoneOffset() >= 720)
s.setTime (s.getTime() - 1440*60*1000);

var dmnetURL = location.protocol + DMNETsendTo+"v="+DMNETversion+"&vst=1";
var dmnetCookieString = document.cookie.toString();

if(dmnetCookieString.indexOf("_dmnid") == -1)
{
DMNETsession = parseInt( Math.random()*1000000 ) + "_" + s.getTime();
var domStr = "";
if(DMNETdomain != "")
{
domStr = "domain="+ DMNETdomain +";";
}
document.cookie = "_dmnid=" + DMNETsession + ";expires=Mon,
31-Dec-2008 00:00:00 GMT;"+domStr+"path=/;";
}
dmnetCookieString = document.cookie.toString();
if(dmnetCookieString.indexOf('_dmnid') == -1)
{
DMNETsession = "";
}
else
{
if(dmnetCookieString.indexOf(';') == -1)
dmnetCookieString = dmnetCookieString.replace(/_dm/g, ';_dm');

var start = dmnetCookieString.indexOf("_dmnid=") + 7;
var end = dmnetCookieString.indexOf(";",start);

if (end == -1)
end = dmnetCookieString.length;
DMNETsession = unescape(dmnetCookieString.substring(start,end));
}
dmnetURL += "&id="+DMNETsession+"&url="+escape(DMNETpage) +
"&ref="+escape(document.referrer)+"&lng=" + ((!document.all ||
navigator.userAgent.match('Opera')) ? navigator.language :
navigator.userLanguage) + "&tz=" + (Math.round(new Date('dec 1,
2002').getTimezoneOffset()/60)*-1);
if(screen)
dmnetURL += "&scr=" + escape( screen.width + "x" + screen.height + " "
+ screen.colorDepth + "bpp" );

dmnetURL += "&rnd=" + new Date().getTime();

if(document.layers)
{
document.write("<la"+"yer name=\"DMStats\" visibility=hide><img
src=\""+dmnetURL+"\" height=1 width=1></la"+"yer>");
}
else
{
document.write("<di"+"v id=\"DMStats\"
STYLE=\"position:absolute;visibility:hidden;\"><img
src=\""+dmnetURL+"\" height=1 width=1></di"+"v>");
}
</script>
<!-- End of DeepMetrix (.NET) StatScript -->
Access Denied

 </body>
</HTML>

Thanks tons for any help you can send my way!!

Regards,
Matt

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-06-26