In my page I used header location for redirection in twitter login. But it is working fine in my server. But it is not working after uploaded the files to other server
header("Location: login-twitter.php");
When try to see what error in the page and used the below code, I see the following warning message.
error_reporting(E_ALL); ini_set('display_errors', 'On');
Warning: Cannot modify header information - headers already sent by (output started at /vhosts/www/samplehosts/mysite.com/samplefolder/header.php:258) in /vhosts/www/samplehosts/mysite.com/samplefolder/signin.php on line 24
The redirection is not working on any of the pages in my site. Anybody can help me to solve this problem
signin.php
if (array_key_exists("login", $_GET)) {
$oauth_provider = $_GET['oauth_provider'];
if ($oauth_provider == 'twitter') {
error_reporting(E_ALL); ini_set('display_errors', 'On');
header("Location: login-twitter.php");
}
}
<li class="twitter">
<a class="twitter_login" href="?login&oauth_provider=twitter" rel="nofollow">
<img src="images/twitter.png" width="206" height="33" >
</a>
</li>
But after click the twitter button just it shows the header URL as
http://mysite.com/?login&oauth_provider=twitter
and not redirecting to twitter login page.