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 8160713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:20:12+00:00 2026-06-06T18:20:12+00:00

how to post something on user wall ( may be a php processed image

  • 0

how to post something on user wall ( may be a php processed image or something text ) when user clicks a button. As an example suppose a facebook user installs my app, then it shows some processed image then if the user wishes to publish he clicks the publish button and get published to his wall otherwise it will not. The difficulty I faced is to to go from one page to another ( as going from index.php to upload.php) ,transferring access_token,and how to make api call to upload the image from upload.php should i have to make upload.php as index.php so as it can re authenticate the user?

  • 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-06-06T18:20:13+00:00Added an answer on June 6, 2026 at 6:20 pm

    You sound really confused.

    There should be no difference if you name your file index.phpor upload.php.

    I don’t see why you would need to manually take care of the access token. Use the PHP SDK, and it is done automatically for you. The PHP SDK uses the $_SESSION variable to store it. Otherwise, you could pass it in the URL as an argument like:

    upload.php?access_token=SOMETHING_REALLY_SECRET
    

    I’d not recommend that though, since it makes your site very vulnerable to attacks.

    There is a complete example in the PHP SDK documentation:

    <?
      // 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('php-sdk/facebook.php');
    
      $config = array(
        'appId' => 'YOUR_APP_ID',
        'secret' => 'YOUR_APP_SECRET',
        'fileUpload' => true,
      );
    
      $facebook = new Facebook($config);
      $user_id = $facebook->getUser();
    
      $photo = './mypic.png'; // Path to the photo on the local filesystem
      $message = 'Photo upload via the PHP SDK!';
    ?>
    <html>
      <head></head>
      <body>
    
      <?
        if($user_id) {
    
          // We have a user ID, so probably a logged in user.
          // If not, we'll get an exception, which we handle below.
          try {
    
            // Upload to a user's profile. The photo will be in the
            // first album in the profile. You can also upload to
            // a specific album by using /ALBUM_ID as the path 
            $ret_obj = $facebook->api('/me/photos', 'POST', array(
                                             'source' => '@' . $photo,
                                             'message' => $message,
                                             )
                                          );
            echo '<pre>Photo 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.
            $login_url = $facebook->getLoginUrl( array(
                           'scope' => 'photo_upload'
                           )); 
            echo 'Please <a href="' . $login_url . '">login.</a>';
            error_log($e->getType());
            error_log($e->getMessage());
          }   
    
          echo '<br /><a href="' . $facebook->getLogoutUrl() . '">logout</a>';
        } else {
    
          // No user, print a link for the user to login
          // To upload a photo to a user's wall, we need photo_upload  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' => 'photo_upload') );
          echo 'Please <a href="' . $login_url . '">login.</a>';
    
        }
    
      ?>
    
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like Facebook's Wall build on PHP that uses MySQL database. Structure:
I want to post on facebook page/user wall my new events offline what i
I want to post something on the user wall. I used the below code
Is there any way to post something to a user's friend's wall from that
I am trying to post something onto the user's wall. However I keep getting
I am creating a Facebook application which should allow the user do post something
I trying to pomp showPermissionDialog for allow the user to post something in a
I'm posting some info to a user's wall via Facebook Connect (from my external
I'm making a simple facebook canvas app (page tab) with PHP, that posts something
I want to post something in the users friends wall. I use this to

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.