通常我討厭用新手代碼問題來到這裏,但沒有人可以用此代碼找到錯誤。也許你們可以:-)在我的php代碼中出現隨機語法錯誤,我無法找到
<?php
defined('SYSPATH') or die('No direct script access.');
/**
* to interact with photos
*
* @author Max Padraig Wolfgang Bucknell-Leahy
*/
class Model_Photos
{
private $apiKey = '12664498208a1380fe49fb1b5a238ef0';
private $secret = '03d43dee65a34513';
private $perms = 'read';
private $sigString = 'test';
private $apiSig = md5($_sigString); //Line 15
private $authArray = array('api_key' => $apiKey,
'perms' => $perms,
'api_sig' => $apiSig);
private $authArrayImploded = implode('&', $authArray);
private $authLink = 'http://www.flickr.com/services/auth/?' . $authArrayImploded;
public function get_photos($number = 5)
{
if(file_exists(APPPATH . 'cache/main_cache.xml')
{
echo $authLink;
} else {
echo 'not so good';
}
}
}
$class = new Model_Photos;
$class->get_photos;
的錯誤是:
Parse error: syntax error, unexpected '(', expecting ',' or ';' in /home/p14s9nnd/public_html/testing.php on line 15
預先感謝您和遺憾
問候, 最大
我很希望我有足夠的代表編輯帖子。我真的無法閱讀你的問題,因爲你格式不好的代碼。 – Felix 2010-05-23 23:00:28
順便說一句,我不知道這是否是有意的,但你首先定義一個'$ sigString'變量,並在下一行使用一個叫'$ _sigString'。只是說。 – Javier 2010-05-23 23:00:55