나는 이상한 오류를 생성하는 facebook 앱을 만들고 있습니다. 다음 내가 직면하고있는 오류입니다 :의 index.php에서facebook app의 PHP 헤더 오류
Warning: Cannot modify header information - headers already sent by (output started at /home/amitver/public_html/roadies/index.php:2) in /home/amitver/public_html/roadies/facebook.php on line 395
Warning: Cannot modify header information - headers already sent by (output started at /home/amitver/public_html/roadies/index.php:2) in /home/amitver/public_html/roadies/facebook.php on line 395
Warning: Cannot modify header information - headers already sent by (output started at /home/amitver/public_html/roadies/index.php:2) in /home/amitver/public_html/roadies/facebook.php on line 395
Warning: Cannot modify header information - headers already sent by (output started at /home/amitver/public_html/roadies/index.php:2) in /home/amitver/public_html/roadies/facebook.php on line 399
처음 몇 줄 수 있습니다 facebook.php에
<?php
require_once 'facebook.php';
//facebook init
$appapikey = '...';
$appsecret = '...';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
$userInfo = $facebook->api_client->users_getInfo($user_id, array('name'));
$name = $userInfo[0]['name'];
//$useruidname = $facebook->api_client->fql_query("SELECT name FROM user WHERE uid='$user_id'");
// Greet the currently logged-in user!
echo 'Hello, '.$name;
?>
라인 394-400은 다음과 같습니다
foreach ($cookies as $name => $val) {
setcookie($this->api_key . '_' . $name, $val, (int)$expires, '', $this->base_domain);
$_COOKIE[$this->api_key . '_' . $name] = $val;
}
$sig = self::generate_sig($cookies, $this->secret);
setcookie($this->api_key, $sig, (int)$expires, '', $this->base_domain);
$_COOKIE[$this->api_key] = $sig;
나를 해결할 수있는 사람이 있습니까?
당신이 옳았습니다. php의 맨 위에 빈 줄이있었습니다. 파이썬이 어렵다고 생각했습니다. 정말로 위선적 인 말투는 내가 이것에 2 시간을 썼다라고 생각한다. .. 고마워. – amit