In short, I want to use FB api for posting the status, in this scenario :
the user have to type some update (in my website) which will posted to db,
the user may check (post to fb) so that the update also appears in his FB profile.
for posting the update in my website I have a textarea in an HTML form which points the action to another php file (to write it in the DB)
Finally I wil I’ll show you both files to be safe and give accurate answers
How to integrate both actions (posting to both FB and DB) , what should I do and where?
Thx
Following the new php-sdk workflow should be easily:
your page should contains the login button with the necessary JS and server-side script to hold the session just like the
example.php. One important note here is that you need to ask the user for thepublish_streampermission so your login button should look like:Now on refresh, you check that you have a valid session so you show the submission form, or the “facebook” checkbox…
After submission and in your action file, for example
post.php:You get the
$_POST['user_status']validate it and submit it to your DB and then check for the facebook checkbox AND if you have a valid session:More details on what you can post is available here.
This should give you an idea how to start. 🙂