[8] ErrorException in News.php line 25

未定义数组索引: news_content

  1. public function index()
  2. {
  3. $page=input('page',1);
  4. $news=Db::name('news')->alias("a")->join(config('database.prefix').'member_list b','a.news_auto =b.member_list_id')->where(array('n_id'=>input('id'),'news_open'=>1,'news_back'=>0))->find();
  5. $admin_array = Db::name('admin')->find($news['member_list_id']);
  6. $news['admin_realname'] = $admin_array['admin_realname'];
  7. if(empty($news)){
  8. $this->error(lang('operation not valid'));
  9. }
  10. $news_data=explode('_ueditor_page_break_tag_',$news['news_content']);
  11. $total=count($news_data);
  12. $news['content']=$news_data[$page-1];
  13. $news['page']='';
  14. if($total>1){
  15. $prevbtn=($page<=1)?'<li class="disabled"><span>&laquo;</span></li>':'<li><a href="' . url('home/News/index',['id'=>input('id'),'page'=>($page-1)]) . '">&laquo;</a></li>';
  16. $nextbtn=($page>=$total)?'<li class="disabled"><span>&raquo;</span></li>':'<li><a href="' . url('home/News/index',['id'=>input('id'),'page'=>($page+1)]) . '">&raquo;</a></li>';
  17. $link=$this->getLinks($page,$total,input('id'));
  18. $news['page']=sprintf(
  19. '<ul class="pagination">%s %s %s</ul>',

Call Stack

  1. in News.php line 25
  2. at Error::appError(8, 'Undefined index: new...', 'E:\phpstudy\PHPTutor...', 25, ['page' => 1, 'news' => ['admin_realname' => '管理员'], 'admin_array' => ['admin_id' => 1, 'admin_username' => 'admin', 'admin_pwd' => '226f04b38d50c0707674...', ...]]) in News.php line 25
  3. at News->index()
  4. at ReflectionMethod->invokeArgs(object(News), []) in App.php line 196
  5. at App::invokeMethod([object(News), 'index'], []) in App.php line 408
  6. at App::module(['home', 'News', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...], false) in App.php line 295
  7. at App::exec(['type' => 'module', 'module' => ['home', 'News', 'index'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...]) in App.php line 123
  8. at App::run() in start.php line 18
  9. at require('E:\phpstudy\PHPTutor...') in index.php line 20

Exception Datas

Error Context
page 1
news { "admin_realname": "\u7ba1\u7406\u5458" }
admin_array { "admin_id": 1, "admin_username": "admin", "admin_pwd": "226f04b38d50c0707674f6481b68c7a0", "admin_pwd_salt": "cwDIIdiUoF", "admin_changepwd": 1530169248, "admin_email": "693434540@qq.com", "admin_realname": "\u7ba1\u7406\u5458", "admin_avatar": "", "admin_tel": "13858481899", "admin_hits": 96, "admin_ip": "127.0.0.1", "admin_time": 0, "admin_last_ip": "122.236.57.69", "admin_last_time": 1530236341, "admin_addtime": 1521697957, "admin_mdemail": "", "admin_open": 1, "member_id": 1 }

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

REDIRECT_PATH_INFO
news/121.html
REDIRECT_STATUS
200
HTTP_HOST
www.lisnando.com
HTTP_CONNECTION
keep-alive
HTTP_ACCEPT_ENCODING
gzip, deflate
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0); 360Spider(compatible; HaosouSpider; http://www.haosou.com/help/help_3_2.html)
PATH
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\
SystemRoot
C:\Windows
COMSPEC
C:\Windows\system32\cmd.exe
PATHEXT
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR
C:\Windows
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache/2.4.23 (Win32) OpenSSL/1.0.2j PHP/5.4.45
SERVER_NAME
www.lisnando.com
SERVER_ADDR
121.41.5.102
SERVER_PORT
80
REMOTE_ADDR
45.35.224.42
DOCUMENT_ROOT
E:/phpstudy/PHPTutorial/WWW/zjzy
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
E:/phpstudy/PHPTutorial/WWW/zjzy
SERVER_ADMIN
admin@php.cn
SCRIPT_FILENAME
E:/phpstudy/PHPTutorial/WWW/zjzy/index.php
REMOTE_PORT
43379
REDIRECT_URL
/news/121.html
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
REQUEST_METHOD
GET
QUERY_STRING
REQUEST_URI
/news/121.html
SCRIPT_NAME
/index.php
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1530429850.32
REQUEST_TIME
1530429850
PATH_INFO
news/121.html
Environment Variables
empty

ThinkPHP Constants

APP_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy/app/
RUNTIME_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy/data/runtime/
THINK_VERSION
5.0.10
THINK_START_TIME
1530429850.3241
THINK_START_MEM
151328
EXT
.php
DS
\
THINK_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy\thinkphp\
LIB_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy\thinkphp\library\
CORE_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy\thinkphp\library\think\
TRAIT_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy\thinkphp\library\traits\
ROOT_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy\
EXTEND_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy\extend\
VENDOR_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy\vendor\
LOG_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy/data/runtime/log\
CACHE_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy/data/runtime/cache\
TEMP_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy/data/runtime/temp\
CONF_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy/app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
true
QINIU_FUNCTIONS_VERSION
7.2.0
ADDON_PATH
E:\phpstudy\PHPTutorial\WWW\zjzy\addons\
QR_MODE_NUL
-1
QR_MODE_NUM
0
QR_MODE_AN
1
QR_MODE_8
2
QR_MODE_KANJI
3
QR_MODE_STRUCTURE
4
QR_ECLEVEL_L
0
QR_ECLEVEL_M
1
QR_ECLEVEL_Q
2
QR_ECLEVEL_H
3
QR_FORMAT_TEXT
0
QR_FORMAT_PNG
1
QR_CACHEABLE
false
QR_CACHE_DIR
false
QR_LOG_DIR
false
QR_FIND_BEST_MASK
true
QR_FIND_FROM_RANDOM
2
QR_DEFAULT_MASK
2
QR_PNG_MAXIMUM_SIZE
1024
QRSPEC_VERSION_MAX
40
QRSPEC_WIDTH_MAX
177
QRCAP_WIDTH
0
QRCAP_WORDS
1
QRCAP_REMINDER
2
QRCAP_EC
3
QR_IMAGE
true
STRUCTURE_HEADER_BITS
20
MAX_STRUCTURED_SYMBOLS
16
N1
3
N2
3
N3
40
N4
10
__ROOT__
MODULE_NAME
home
CONTROLLER_NAME
News
ACTION_NAME
index