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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:34:22+00:00 2026-05-31T11:34:22+00:00

I’ve developed a Flash quiz app for facebook, which calls for a php script

  • 0

I’ve developed a Flash quiz app for facebook, which calls for a php script silently upon completion. The php script’s function is to generate an image from the POST data sent by the flash, and then post it to the user’s wall.

That would be all neat and dandy, but for some reason the image never gets uploaded, probably because when i call it, it’s like http://www.myhost.com/appfolder/img-generate.php, and the facebook SDK script inside gets an Oauth error, probably because it is not embedded in their canvas.

My question is:

If I’d like to have my php script generate an image and upload it to the fb wall, then how should I call it from the flash?

This is the AS2 code I’m using currently:

callRemoteFile = function(ourVariable:Number) {
        var result_lv:LoadVars = new LoadVars();
    result_lv.onLoad = function(success:Boolean) {
                if (success) {
                        if (result_lv.message=="success")
                                trace("done! "+result_lv.returnValue);
                        else
                                trace(result_lv.message);
                } else {
                        trace("Error connecting to server");
                        return false;
                }
    };
    var send_lv:LoadVars = new LoadVars();
    send_lv.ourVariable = ourVariable;
    send_lv.sendAndLoad(" http://www.myhost.com/appfolder/img-generate.php", result_lv, "POST");
}
callRemoteFile(String(health.toString()));

and this is the img-generate PHP (I’ve omitted most of the image functions and the getting of the POST data, because they are unrelated to my problem here):

include 'facebook.php';
$app_id = "111111111111111";
$app_secret = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
$facebook = new Facebook(array(
        'appId' => $app_id,
        'secret' => $app_secret,
        'cookie' => true,
));

$date = date("ymdHis");

$im = imagecreatefromjpeg('myimg.jpg');
imagejpeg($im,'temp/'. $date . md5($ida) . '.jpg');

$facebook->setFileUploadSupport(
    "http://" . $_SERVER["SERVER_NAME"]
);

$photo = $facebook->api("/me/photos", "POST", array(
    source => "@" . 'temp/'. $date . md5($ida) . '.jpg',
    message => "Something to display with the image"
));

If I simply navigate to the php with my browser it giver me this:

Fatal error: Uncaught OAuthException: Invalid OAuth access token signature. thrown in /home/a01223445/public_html/appfolder/base_facebook.php on line 1039

If I view the same php through facebook canvas it works perfectly. My problem is: The canvas will show the flash and I want the php to silently be evaluated while the flash is running.

Sorry for the long question,

Thank you for your help in advance!

  • 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-31T11:34:24+00:00Added an answer on May 31, 2026 at 11:34 am

    I had the same problem I needed to add the realpath()

    $path = realpath('/'. $imgcode. '.jpg');
    array(
            'source' =>  "@" . $path,
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.