Facebook重定向Uri没有返回并被困在白页

时间:2017-06-30 09:01:27

标签: php facebook-sdk-4.0 facebook-sharer facebook-graph-api-v2.8

我尝试让fb sharer发布好,但之后不再返回我的重定向uri url 并坚持这个fb页面

https://web.facebook.com/dialog/return/close?_rdc=1&rdr#=_

这是我的共享代码

<a href="https://www.facebook.com/sharer/sharer.php?app_id=423436984657946&u=<?=$_IM['siteurl'];?>/sview/<?=$qf['url'];?>/<?=$_SESSION['FBID'];?>&picture=<?=$a_img;?>&title=<?=$a_title;?>&description=<?=$a_desc;?>&redirect_uri=<?=$a_return;?>"><button type="button" style="background: blue;border:2px solid blue;" ="" ><i class="fa fa-facebook"></i> শেয়ার করুন</button>                           </a>

如果您需要阅读完整代码,我也会提交

  <?php 
        require_once __DIR__ . '/config.php'; 
        $helper = $fb->getRedirectLoginHelper(); 
        try { 
        $accessToken = $helper->getAccessToken(); 
        } catch(Facebook\Exceptions\FacebookResponseException $e) { 
        // When Graph returns an error 
        echo 'Graph returned an error: ' . $e->getMessage(); exit; 
        }
         catch(Facebook\Exceptions\FacebookSDKException $e) { 
        // When validation fails or other local issues 
        echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; 
        } 
        if (isset($accessToken)) { 
        $_SESSION['access_token'] = (string) $accessToken; 
        } 
        if(isset($_GET['app'])){    
        $aid=$_GET['app'];  
        $app=$idb->prepare("SELECT * FROM allapps WHERE url=?");    
        $app->bind_param("s",$aid);     
        $app->execute();    
        $a_r=$app->get_result();    
        $naf=$a_r->fetch_assoc();   
        $views=$naf['views']+1; 
        $v=$idb->prepare("UPDATE allapps SET views=? WHERE id=?");  
        $v->bind_param("ss",$views,$naf['id']);     
        $v->execute(); 
        if($a_r->num_rows<1){   igo($_IM["siteurl"]."/404.php"); 
        } 
        $title=$naf['title']; 
        } 
        include "header.php"; 

        if(!isset($_SESSION['FBID'])){  
        echo "Login First";     
        exit(); 
        } ?> 
        <div class="row"> 
            <div class="col-md-9">      
        <div class="row">           
        <div class="col-md-12">                 
        <div class="ibrdr">                     
        <div class="apps_c">                    
        <?php 
        if(isset($_GET['app'])) {                       
        $gid=$_GET['app'];                                              
        $guser=$_SESSION['FNAME'].", ";                             
        $q=$idb->prepare("SELECT * FROM apps_text WHERE url=? ORDER BY rand()");                            
        $q->bind_param("s",$gid);                           
        $q->execute();                          
        $qr=$q->get_result();                           
        $qf=$qr->fetch_assoc();                             
        $text1=$qf['text'];                             
        $fbid=$_SESSION['FBID'];                            
        $gpropic=$_SESSION['propic'];                           
        if(file_exists("apps-f/".$qf['url'].".php")){                                   
        include ("apps-f/".$qf['url'].".php");                                  
        $a_title=$naf['title'];                                     
        $a_desc=$naf['title']." - দেখতে এখানে ক্লিক করুন" ;                                     
        $a_img=$_IM['siteurl']."/images/generated/".$naf["url"]."-".$fbid.".jpg"; 
        $a_return=$_IM['siteurl']."/".$gid."";                              
        }                               else {                                  
        echo "Not Found!";                              
        }                           
        }            
        echo '<center>'; 
        include 'ads.php'; 
        echo '<center>';        
        ?>                      
        <span style="display: block;">                          
        <button type="button" onClick="window.location.reload()" >রিফ্রেশ</button>                          

        <a href="https://www.facebook.com/sharer/sharer.php?app_id=423436984657946&u=<?=$_IM['siteurl'];?>/sview/<?=$qf['url'];?>/<?=$_SESSION['FBID'];?>&picture=<?=$a_img;?>&title=<?=$a_title;?>&description=<?=$a_desc;?>&redirect_uri=<?=$a_return;?>"><button type="button" style="background: blue;border:2px solid blue;" ="" ><i class="fa fa-facebook"></i> শেয়ার করুন</button>                           </a> 

            <?php echo '<center>'; include 'ads.php'; echo '<center>'; ?>                       
        </span>                     
        </div>              
        </div>          
        </div>      
        </div> 
        <div class="row">           
        <div class="col-md-12">                 
        <div class="ibrdr">                     
        <?php include 'ads.php'; ?> 
        </div>              
        </div>          
        </div>      
        <div class="row">           
        <div class="col-md-12">                 
        <div class="ibrdr">                     
        <h2>All Apps</h2>                   
        <?php                       
        $aapp=$idb->prepare("SELECT * FROM allapps ORDER BY id DESC");                      
        $aapp->execute();                       
        $ar=$aapp->get_result();                        
        while($af=$ar->fetch_assoc()){                  ?>                      
        <div class="col-md-4">                          
        <div class="thumbnail" style="min-height: 250px;">                              
        <?php                               
        if(isset($_SESSION['access_token'])){                                       
        $nu="";                                     
        } else {                                        
        $nu=".php"; }                               
        ?>      
        <a href="<?=$_IM['siteurl'];?>/<?=$af['url'].$nu;?>">                               
        <img src="<?=$_IM['siteurl'];?>/<?=$af['img'];?>" alt="<?=$af['title'];?>" class="img-responsive" />                                
        <div class="caption"><?=$af['title'];?></div> </a>  </div> </div> 
        <?php 
        }?>                 
        </div>          
        </div>      
        </div> 
            </div> 
            <?php include "right_content.php";?> 
        </div> 
        <?php include "footer.php"; ?>

0 个答案:

没有答案