Kailash Rajendhar
Kailash Rajendhar

Reputation: 25

Error in post a status in Facebook using Php

I was put files in following url http://the-designhut.com/poststatus. i was placed the facebook-php-sdk files in above url. And also i created client id and secret id for this process.

my php code is,

<?php
 require_once 'src/facebook.php';
 $appId= 'appid';
 $secret='secret code';
 $returnurl='http://the-designhut.com/poststatus/';
 $permission='manage_pages, publish_stream';
 $fb = new Facebook(array('appId'=>$appId, 'secret'=>$secret));

 $fbuser = $fb->getUser();
 if($fbuser){
  }
 else{
 $loginurl = $fb->getLoginUrl(array('scope'=>$permission, 'redirect-      url'=>$returnurl));
 echo'<a href="'.$loginurl.'">Login with FB</a>';
 }
 ?>

but when i run my file i got an error message. that is,

Given URL is not permitted by the Application configuration: One or more of the given URLs is not permitted by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

what i do for clear the above error?

Upvotes: 0

Views: 66

Answers (1)

Javier de la Cueva
Javier de la Cueva

Reputation: 816

That error means that you have not added your domain to your Facebook App settings or the domain you have added is not the-designhut.com

https://developers.facebook.com/apps/{YOUR_APP_ID}/settings/ ("App Domains" field)

Update your settings and it will work.

I hope it helps.

Upvotes: 3

Related Questions