Thank you all for your help, now it works!
For those who want to do some stuff with the Mt Gox API via php, that works:
Puplic stuff
function get_data($url)
{
$useragent="Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$site="https://mtgox.com/code/data/getDepth.php";
$data=get_data($site);
echo $data;
Account stuff:
function get_data($url)
{
$useragent="Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "name=yourname&pass=yourpass");
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$site="https://mtgox.com/code/getFunds.php";
$data=get_data($site);
echo $data;
A referrer is not necessary, but you have to set the useragent.