Take the 2-minute tour ×

I am working to post some content to user's wall from my website.

I created an application on facebook.

Should I manually create a dialog box redirecting user to something like that?


How can I check if user already connected application on my website?

Should I store any of the user's facebook data when he allows my application to remember if already connected?

Data comes like that as told in http://developers.facebook.com/docs/reference/dialogs/oauth/


Then how can I post some contect with PHP?

I read something here but cant understand actually...


Any help appreciated


share|improve this question

3 Answers 3

up vote 0 down vote accepted

Did you check out the PHP SDK? There's an example showing how to authenticate a user in there and to post to the wall, check out the "graph()" (which you cannot call directly, you can call "post" directly on the facebook class if I recall, see the "_call()" method) method and check out the documentation again.

Let me know if that helps otherwise we'll take it from there.

share|improve this answer
i checked it, but my question is how can i know if user already connected to app on my website ? should i store the token or sth comes from facebook when user allows my app ? –  RULE101 Apr 4 '11 at 15:11
I don't think there's a way for you to know that. Even if you "remembered" when the user connected to your app, he could always disconnect your app from his Facebook profile later on. But why do you need to know that anyway? Either he has connected your app, in which case you can post to his wall, or he hasn't, in which case you can show him the Facebook Connect Button..? –  Chris Apr 4 '11 at 15:16
for example in soundcloud.com, there is connections settings page, and when i click connect to facebook, i allow the application and it says connected, and then i select if i want to post on my wall when i favorited sth on soundcloud.com. i can disconnect whenever i want from this page also. soundcloud checks if i am connected when i go settings page, i am asking bout this, how they know i am connected ? –  RULE101 Apr 4 '11 at 15:22

Facebook session parameters will help you to found out whether user in connected to your app or not. e.g. if you are using php-sdk

$session = $facebook->getSession();


//do something


//do something
share|improve this answer

I find the PHP SDK for "viral" channel convoluted and a poor user experience. Checking if the user has "auhtorized" your app is easy, as was pointed out already. But if the user hasn't, then requesting authorization is a lot of back and forth communication (http://developers.facebook.com/docs/authentication/). That's before you can post to their wall. Which still requires redirects if done from the server (http://developers.facebook.com/docs/reference/dialogs/).

I find it a lot easier to use the javascript SDK. Check if they have authorized your app (FB.getLoginStatus), if not then ask for authorization (FB.login), then use FB.ui to post to their own wall or a friend's wall. It's all done client side, no calls back to the server necessary, no page reloads or redirects.

share|improve this answer

Your Answer


