hey, also mittels jquery sende ich einen post request
Code:
$.post("work.php?request=reg", { user: user, api: key },
function(data){
alert(data["account"]["firstname"]);
});
der php teil sieht wie folgt aus:
PHP-Code:
$json = @file_get_contents("http://marketplace.envato.com/api/edge/".$_POST['user']."/".$_POST['api']."/account.json");
if($json == false) {
die("Wrong information");
}
die(json_decode($json, true));
der php code gibt folgendes array aus:
Code:
array(1) {
["account"] => array(3) {
["balance"] =>
string(4) "0.00"
["country"] =>
string(7) "Germany"
["firstname"] =>
string(6) "Daniel"
}
}
ich schaffs ums verrecken nicht auf firstname oder country etc zuzugreifen mit javascript (bei data). kann mir bitte jemand helfen?! hab schon sämtliche array übersichten im inet ngeschaut, aber ich bekomms ned hin
danke
grüße