views:

63

answers:

1

Hello,

I want to post in my Facebook page Wall a message through my web page. I manage to do this with the next code:

<?php
$config['baseurl']  =   "http://....facebook/index.php";

if ($fbme){
    if (isset($message)){
        try {
            $statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> $message, 'picture'=> $Image,'cb' => ''));
        } catch (FacebookApiException $e) {
            d($e);
        }
    }
}
?>

I am using the $config in the login and logout functions:

function login(){
     document.location.href = "<?=$config['baseurl']?>";
 }
 function logout(){
     document.location.href = "<?=$config['baseurl']?>";
 }

Also I am using a facebook button for login:

<fb:login-button autologoutlink="true" onlogin="parent.location='http://www.facebook.com/profile.php?id=&lt;?php echo $uid ?>'" perms="email,user_birthday,status_update,publish_stream"></fb:login-button>

Ok. Now when I click a button in my web site I go to my facebook application and first of all if asks me to login. Then when I am logged in I go immediately to my profile page for see the message in my Wall. everything works ok. The problem is that when I am refreshing my facebook page I get again the same message in my Wall, so I have it twice. This happens only two times.

Does anyone know what could be wrong?

Thanks in advance

A: 

Anyway I changed the login function and it worked:

 function login(){
        //document.location.href = "<?=$config['baseurl']?>";
        parent.location = "http://www.facebook.com/profile.php?id=&lt;?=$uid ?>"
   }

My problem is that this thing works only in Firefox, not in IE, Safari and Chrome. Does anyone know how to solve it??

Thanks

novellino