How to show data on a facebook app canvas?
I have tried following some tutorials and I get the concept of how the apps work, basicly they are in my case a php/mysql site that loads into facebook and gives me access to the userbase instead of needing my own userbase.
Here is what I am trying right now to show on the facebook application canvas page
/* initialize the facebook API with your application API Key
and Secret */
$facebook = new Facebook('MY API KEY','MY API SECRET');
/* require the user to be logged into Facebook before
using the application. If they are not logged in they
will first be directed to a Facebook login page and then
back to the application's page. require_login() returns
the user's unique ID which we will store in fb_user */
$fb_user = $facebook->require_login();
/* now we will say:
Hello USER_NAME! Welcome to my first application! */
?>
Hello <fb:name uid='<?php echo $fb_user; ?>' useyou='false' possessive='true' />! Welcome to my first application!
Instead of showing anything from my script though it just shows these errors when I access the facebook page
Errors while loading page from application
Parse errors:
CSS Error (line 35 char 17): Error in parsing value for property.: 'font-style' Declaration dropped.
FBML Error (line 53): illegal tag "body" under "fb:tab-position"
FBML Error (line 54): illegal attr ";" in tag "div". Attribute names can only contain alphanumeric characters, underscores, and hyphens.FBML Error (line 85): illegal tag "object" under "fb:tab-position"
FBML Error (line 86): illegal tag "param" under "fb:tab-position"
FBML Error (line 87): illegal tag "param" under "fb:tab-position"
FBML Error (line 88): illegal tag "embed" under "fb:tab-position"
FBML Error (line 221): illegal tag "object" under "fb:tab-position"
开发者_Python百科FBML Error (line 222): illegal tag "param" under "fb:tab-position"
FBML Error (line 223): illegal tag "param" under "fb:tab-position"
FBML Error (line 225): illegal tag "embed" under "fb:tab-position"
FBML Error (line 264): illegal tag "object" under "fb:tab-position"
FBML Error (line 265): illegal tag "param" under "fb:tab-position"
FBML Error (line 266): illegal tag "param" under "fb:tab-position"
FBML Error (line 268): illegal tag "embed" under "fb:tab-position"
FBML Error (line 276): illegal tag "noscript" under "fb:tab-position"
FBML Error (line 321): illegal tag "noscript" under "fb:tab-position"
Runtime errors:
Cannot allow external script
The weird thing is I can remove all this from my page and just try to show basic text or anything on the canvas page and it will still give me these errors, am I missing something?
Facebook is most definitely loading some sort of HTML. Since you've said that even when your page is almost entirely blank you still get these errors, have you confirmed that your Facebook app is, in fact, pointing to the correct URL?
I'm also assuming that you tried to access the PHP script from your own browser, too, to ensure that your script is printing what you think it is.
精彩评论