新問題 = = 我用了網路上例子 印出25位朋友名單
程式碼如下
# <?php
// Copyright 2007 Facebook Corp. All Rights Reserved.
//
// Application: Example
// File: 'index.php'
// This is a sample skeleton for your application.
//
require_once 'facebook.php';
$appapikey = '';
$appsecret = '';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
// Greet the currently logged-in user!
echo "<p>Hello, <fb:name uid=\"$user_id\" useyou=\"false\" />!</p>";
// Print out at most 25 of the logged-in user's friends,
// using the friends.get API method
echo "<p>Friends:";
$friends = $facebook->api_client->friends_get();
$friends = array_slice($friends, 0, 25);
foreach ($friends as $friend) {
echo "<br>$friend";
}
echo "</p>";
?>
但印出後卻顯示出錯誤
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\Compliments\facebook-platform\php\index.php:1) in C:\AppServ\www\Compliments\facebook-platform\php\facebook.php on line 390
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\Compliments\facebook-platform\php\index.php:1) in C:\AppServ\www\Compliments\facebook-platform\php\facebook.php on line 390
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\Compliments\facebook-platform\php\index.php:1) in C:\AppServ\www\Compliments\facebook-platform\php\facebook.php on line 390
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\Compliments\facebook-platform\php\index.php:1) in C:\AppServ\www\Compliments\facebook-platform\php\facebook.php on line 394
Hello, !
那個#哪來的?你在
<pre class="c" name="code">
# <?php
require_once 'facebook.php';
的<?php前面不應該有任何東西,那個錯誤訊息是這樣來的