mysql - Facebook app error with access token -


i have flash game facebook. yesterday worked correct, inserted data database, when try start app/game got error: fatal error: uncaught oauthexception: active access token must used query information current user. thrown in /home/padekime/domains/padekime.eu/public_html/images/base_facebook.php on line 1254

here code:

<?php $request = $_request["signed_request"]; list($encoded_sig, $load) = explode('.', $request, 2); $fbdata = json_decode(base64_decode(strtr($load, '-_', '+/')), true); if (!empty($fbdata["page"]["liked"])) { ?> <?php  require_once('images/facebook.php');    $facebook = new facebook(array(     'appid'  => 'yyyyyyyyyyyyyyyyyyyyyyy',     'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx',   ));    # user id   $user = $facebook->getuser(); $user_profile = $facebook->api('/me'); $coded = $_request['code']; $name = "".$user_profile['name']."";    if ($user) {     try {   ?>  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-8" /> <title>eurokos</title> </head> <body bgcolor="#ffffff"> <!--url's used in movie--> <!--text used in movie--> <!-- saved url=(0013)about:internet --> <center> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="643" id="eurokos" align="middle"> <param name="allowscriptaccess" value="samedomain" /> <param name="movie" value="memory22.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="memory22.swf" quality="high" bgcolor="#ffffff" width="550" height="643" name="eurokos" align="middle" allowscriptaccess="samedomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> </center> </body> </html>  <?php echo "name: " . $user_profile['name']; $name = $user_profile['name']; session_start(); $_session['vardas'] = $name;   echo $facebook->getaccesstoken();       $apiresponse = $facebook->api('/me/photos', 'post', $post_data);      } catch (facebookapiexception $e) {       $user = null;       error_log($e);     }   } else { $redirecturi = 'http://www.facebook.com/juokoera/app_156187751211405?ref=ts';     $loginurl = $facebook->getloginurl( array(         'scope' => 'publish_stream,photo_upload',         'redirect_uri' => $redirecturi     ));     echo("<script>top.location.href = '" . $loginurl . "';</script>");   } ?> <html> <?php  ?>  <a href="band.php?varname=<?php echo $name ?>">page2</a>; <form method="post" action="band.php">     <input type="hidden" name="vardas" value="$name">     <input type="submit"> </form>  </body> </html> <?php }else {?> <?php //$link = 'http://www.google.lt'; // url link //$src = 'http://www.juokoera.lt/plaukai/images/plaukaineuzvedus.jpg'; // image url //echo '<a href="'. $link .'"><img style="border:none;" src="'. $src .'" /></a>'; ?> <div align="center"><?php $image_off = 'http://www.juokoera.lt/atostogos/images/atostogosu.jpg'; $image_on = 'http://www.juokoera.lt/atostogos/images/atostogosn.jpg'; echo '<img src="http://www.juokoera.lt/atostogos/images/atostogosn.jpg" onmouseover="this.src=\''.$image_off.'\';" onmouseout="this.src=\''.$image_on.'\';"/>'; ?></div> <?php } ?> 

i don't know what's wrong, yesterday worked, echo $facebook->getaccesstoken(); returned access token, today app doesn't work. me? thank you.

the access_token valid hour, unless you've converted long-lived access token. if access_token returns error, advised user login again or use javascript sdk new token user (you can use function fb.getloginstatus() function)

the access_token can expire if user changed password.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -