Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6664089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:34:17+00:00 2026-05-26T02:34:17+00:00

I got the sample code from Facebook to post a message. At first it

  • 0

I got the sample code from Facebook to post a message. At first it worked fine. The next day I tried to clean up the code and it stopped working. I brought back the sample code from Facebook, to take out all my changes, and it still did not work.

I put in print statements to follow the code.

$user_id is false, so it displayes a login in. The login in no longer goes to a login in screen. It calls my return url, which then sees $user_id as being false and diplays the login in again.

I did notice when my call back was being called, I had the following values:

v?state=452c9492a3d51962909f5e000bcb0965

and code

code=AQDucDgsdc3lZFVN2MC3Oj2oB0n1LT4FjOrG3MbgwL4uhh–LS-mRdtjU-6oSUZxsR6UhTKuUDVn3hrasJAe5r1I6ksIDJz1nnTo1mjCqEInJKvQ2qK5A-N3_Nt5buGLqsirb8ccg21N4nWVWkk_iRePwX9f68qK1j-2O6E_USpKvRJeNP3bcwLBiTBJpDVu7aA#=

I was wondering maybe when I was trying to clean up the code and kept running it, Facebook flagged my app as spamming? I posted 26 posts to my wall – is that too many? And how would I check if my app has been flagged as a spammy app?

This is the sample code I used

<?
// Remember to copy files from the SDK's src/ directory to a
// directory in your application on the server, such as php-sdk/
require_once('facebook.php');

$config = array(
    'appId' => 'myappid',
'secret' => 'mysecret',
);

$facebook = new Facebook($config);
$user_id = $facebook->getUser();
?>
<html>
<head></head>
<body>

<?
if($user_id) {
    print ("tryinmg to do a poast");
    // We have a user ID, so probably a logged in user.
    // If not, we'll get an exception, which we handle below.
    try {
        $ret_obj = $facebook->api('/me/feed', 'POST',
                                array(
                                  'link' => 'www.example.com',
                                  'message' => 'Posting with the PHP SDK!'
                             ));
        echo '<pre>Post ID: ' . $ret_obj['id'] . '</pre>';

    } catch(FacebookApiException $e) {
        // If the user is logged out, you can have a 
        // user ID even though the access token is invalid.
        // In this case, we'll get an exception, so we'll
        // just ask the user to login again here.
        print ("face book exception log in");
    $login_url = $facebook->getLoginUrl( array(
                   'scope' => 'publish_stream'
                   )); 
        echo 'Please <a href="' . $login_url . '">login.</a>';
        error_log($e->getType());
        error_log($e->getMessage());
  }   
  // Give the user a logout link 
  echo '<br /><a href="' . $facebook->getLogoutUrl() . '">logout</a>';
} else {
    print ("no user login in do login");
    // No user, so print a link for the user to login
    // To post to a user's wall, we need publish_stream permission
    // We'll use the current URL as the redirect_uri, so we don't
    // need to specify it here
    $login_url = $facebook->getLoginUrl( array( 'scope' => 'publish_stream' ) );
    echo 'Please <a href="' . $login_url . '">login.</a>';
} 

?>
</body> 
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:34:18+00:00Added an answer on May 26, 2026 at 2:34 am

    Naturally, Facebook has a limit for the number of post per day your app can make to a user wall. And FB have policy for user to report spammy apps as well.

    The exact maximum number of posts depends on your application FB ranking. In my experience, 26 posts on a user wall is near the limit for new application.

    If that is the case, you should receive the error message from Facebook, which says something like “you have reached limit of posts…”

    P/s: It seems you need time to refactoring your question, though. If I have not met this situation before, I won’t understand your question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
I just started the use of Mapkit Framework. I got a sample code from
I got a sample snippet code from OpenNETCF and cfAes, but name space definition
I've got running sample python code which is fine in Ubuntu desktop: import dbus,
Am working with web service. Got some sample code from internet. Got some error
I've got this sample code I got from somewhere around the web. My .h
I'm signed up, I've downloaded sample code, I've got a WSDL...and yet I have
I've got a source code file that started as a copy of some sample
I'm going to use the sample code from http://gettinggeneticsdone.blogspot.com/2009/11/split-apply-and-combine-in-r-using-plyr.html for this example. So, first,
I'm practicing drawing polyline on the Map. I've adopted Sample code from download here.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.