I'am having a quiz program on my site where user logs in through their facebook account and play the quiz.
After successfully completing the quiz I want to post their score and rank on their wall. Facebook login and logout is working fine. How do I show their score and rank on their wall without displaying a dialog box?
I'm using this code to post the score and rank on user's wall-
require 'src/facebook.php';
<?php
$facebook = new Facebook(array(
'appId' => 'APP ID',
'secret' => 'SECRET KEY',
));
?>
<script>
FB.init({
appId:'APP ID', cookie:true,
status:true, xfbml:true
});
FB.ui({ method: 'feed',
message: '<?php echo "My score is ".$myscore." and rank is ".$rank; ?>'});
</script>
This code is opening a dialog box for me but that is with empty input field. If user will hust click on 'Publish' button then nothing will be posted on their wall and if they edit the text in input field then they will post wrong information. Either this field should be un editable or this box should not be there.
Please suggest me a solution with code example.