0

I integrated Login with FB and Twitter; but I'm getting error when I click Login in Facebook link

check at http://delhicertificates.in/

Warning: Cannot modify header information - headers already sent by (output started at /home/delhioia/public_html/index.php:7) in /home/delhioia/public_html/facebook/index.php on line 12

/home/delhioia/public_html/facebook/index.php

<?php
//Always place this code at the top of the Page
if (isset($_SESSION['id'])) {
    // Redirection to login page twitter or facebook
    header("location: home.php");
}
if (array_key_exists("login", $_GET)) {
    $oauth_provider = $_GET['oauth_provider'];
    if ($oauth_provider == 'twitter') {
        header("Location: login-twitter.php");
    } else if ($oauth_provider == 'facebook') {
        header("Location: login-facebook.php");
    }
}
?>
<div style='padding-top:5px;'>
<a href="?login&oauth_provider=twitter"><img src="../img/twitter_signin.png"></a><a href="?login&oauth_provider=facebook"><img src="../img/facebook_signin.png"></a>
</div>

Edited by abhi10kumar

5
Contributors
6
Replies
32
Views
4 Years
Discussion Span
Last Post by broj1
0

session_start() is already in index.php (at root); I'm using include() to include this file

0

Please check if there is any "echo" statement above any header.If there is then it will give this error or there might be some spaces.
Check this link.

0

try placing this at the top of your page:

<? ob_start(); ?>

then at the bottom of the page place this line of code:

<? ob_flush(); ?>
0

I assume the /home/delhioia/public_html/facebook/index.php file is being included from /home/delhioia/public_html/index.php, right?

The error message says that /home/delhioia/public_html/index.php is sending output on line 7, probably before inclusion of the /home/delhioia/public_html/facebook/index.php that is why the error, I presume (provided that my assumptions are right).

Edited by broj1

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.