title: Redirect page after site login with facebook
body: <p>I am getting problem to redirect page after website login with facebook. <br>
  1. On click of facebook login button from site it redirect to facebook login page<br>
  2. User get authenticate but it is not redirecting to next page given in <code>headrer('');</code><br>
  3. If i refresh same page then it redirect to given location and url is looking like =">http://192.1.1.1/mysite/welcome.php/#<em>=</em><br>
  4. It is working properly for <a href="http://google.com" rel="nofollow">google.com</a> but not for local url and google url is looking like <a href="https://www.google.co.in/#_=_" rel="nofollow">incorrect google url</a>
  My code <br></p>
  
  <pre><code>if(isset($_GET['fb']))
  {
     $token_url = "https://graph.facebook.com/oauth/access_token?"."client_id=".$config['App_ID']."&amp;redirect_uri=".urlencode($config['callback_url'])."&amp;client_secret=".$config['App_Secret']."&amp;code=".$_GET['code'];   
     $response = file_get_contents($token_url); 
     $params = null;
     parse_str($response, $params);
  
     $graph_url = "https://graph.facebook.com/me?access_token=".$params['access_token'];
     $user = json_decode(file_get_contents($graph_url));  //user data from facebook
  
     $email = $user-&gt;{'email'};    //i am getting email id from json data
  
     //search out for entry available for email in database
     $val_user = "SELECT email FROM tbl_facebook WHERE email ='".$email."'";
     $res_val_user = $con-&gt;query($val_user);
     $count = mysqli_num_rows($res_val_user);
     // if not then insert data to database
     if($count==0)
     {
         $ins_fb = "INSERT INTO tbl_facebook set email='".$email."'";
         $res_fb = mysqli_query($con,$ins_fb);
         if($res_fb)
         {
            //echo "facebook data saved"; exit; //working for this   
            //header('Location:https://www.google.co.in/'); //working for this also
            header('Location:http://192.1.1.1/mysite/welcome.php');
         }
         else
         {
            echo "facebook data is not saved";
         }
     }
     else // if yes then redirect to welcome page
     {
          //echo "login successfully"; exit; // working for this also 
          header('Location:http://192.1.1.1/mysite/welcome.php');  // getting problem to redirect
          //header('Location:https://www.google.co.in/'); 
     } 
  }
  </code></pre>
  
  <p><br>
  <br></p>
  
  <pre><code>&lt;?php
    // code for facebook login
  
   require 'lib/facebook/src/config.php';
   require 'lib/facebook/src/facebook.php';
  // Create our Application instance (replace this with your appId and secret).
  $facebook = new Facebook(array(
        'appId'  =&gt; $config['App_ID'],
        'secret' =&gt; $config['App_Secret'],
        'cookie' =&gt; true
  ));
  ?&gt;
  </code></pre>
  
  <p><br>
  <br></p>
  
  <pre><code>&lt;a class="btn-facebook" href="https://www.facebook.com/dialog/oauth?client_id=&lt;?php echo $config['App_ID']?&gt;&amp;redirect_uri=&lt;?php echo $config['callback_url']?&gt;&amp;scope=email,user_likes,publish_stream"&gt;
                      &lt;i class="icon-facebook icon-large"&gt;&lt;/i&gt;
                      Signin with Facebook
                  &lt;/a&gt;
  </code></pre>