How can I get the top URL (Facebook\'s address) in my iframe application?
Is there a good solution on that?
You can probably figure this out from the "signed_request" POST parameter that Facebook sends to apps loaded within pages.
In PHP that's:
$_POST["signed_request"]
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
$page_id = $data["page"]["id"];
If you want to prevent technical users from being able to spoof the parent page's identity, you can validate the $encoded_sig; this is probably overkill, however.
The $page_id is just a number, so you'll need to use other Facebook APIs (or make a call to "http://www.facebook.com/pages/k/$page_id" and see where you're redirected to) to get the full URL.