Форум программистов, компьютерный форум, киберфорум
PHP для начинающих
Войти
Регистрация
Восстановить пароль
Карта форума Темы раздела Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.71/7: Рейтинг темы: голосов - 7, средняя оценка - 4.71
0 / 0 / 0
Регистрация: 16.11.2018
Сообщений: 4
1

Ошибка Undefined index: text

16.11.2018, 20:48. Показов 1340. Ответов 2

Author24 — интернет-сервис помощи студентам
Добрый день, ребята. Помогите решить проблему. Скопировал сайт и базу и поставил 2 копии на одном хосте. одна копия работает, вторая вот что выдает
Есть ошибка Undefined index: text, а ниже вот чего:
/var/www/user118605/data/www/s118605.smrtp.ru/themes/classic/views/includes/action.php(25)

13 </div>
14 </div>
15 </div> -->
16
17
18 <section class="auto-mark" style="margin-left: -15px; margin-right: -15px; width: calc(100% + 30px)">
19 <div class="container">
20 <div class="row">
21 <div class="multi_bg_example col-sm-12 col-md-6">
22 <div class="car-bg" style="background-image: url('<?php echo $images[0]->path; ?>')">
23 <div class="top_red_line">
24 <div class="trl_text"><?php echo $this->tVars['name']; ?></div>
25 <p><?php echo $this->tVars['text']; ?></p>
26
27 </div>
28 <div class="text-center">
29 <div class="btn-blue">Записаться</div>
30 </div>
31 </div>
32 </div>
33
34 <div class="col-md-6">
35 <div class="row" style="display: flex; flex-flow: row wrap; align-items: center; height: 180px; width: 562px;">
36
37 <?php

Stack Trace

#0 – /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CBaseController.php(127): require("/var/www/user118605/data/www/s118605.smrtp.ru/themes/classic/vie...")
122 $data=$_data_;
123 if($_return_)
124 {
125 ob_start();
126 ob_implicit_flush(false);
127 require($_viewFile_);
128 return ob_get_clean();
129 }
130 else
131 require($_viewFile_);
132 }

#1
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CBaseController.php(96): CBaseController->renderInternal("/var/www/user118605/data/www/s118605.smrtp.ru/themes/classic/vie...", array("content" => "<p>В услугу Сезонный сервис входит:</..."), true)
091 {
092 $widgetCount=count($this->_widgetStack);
093 if(($renderer=Yii::app()->getViewRenderer())!==null && $renderer->fileExtension==='.'.CFileHelper::getExtension($viewFile))
094 $content=$renderer->renderFile($this,$viewFile,$data,$return);
095 else
096 $content=$this->renderInternal($viewFile,$data,$return);
097 if(count($this->_widgetStack)===$widgetCount)
098 return $content;
099 else
100 {
101 $widget=end($this->_widgetStack);

#2
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(870): CBaseController->renderFile("/var/www/user118605/data/www/s118605.smrtp.ru/themes/classic/vie...", array("content" => "<p>В услугу Сезонный сервис входит:</..."), true)
865 */
866 public function renderPartial($view,$data=null,$return=false,$processOutput=false)
867 {
868 if(($viewFile=$this->getViewFile($view))!==false)
869 {
870 $output=$this->renderFile($viewFile,$data,true);
871 if($processOutput)
872 $output=$this->processOutput($output);
873 if($return)
874 return $output;
875 else

#3
– /var/www/user118605/data/www/s118605.smrtp.ru/themes/classic/views/layouts/main.php(304): CController->renderPartial("/includes/action", array("content" => "<p>В услугу Сезонный сервис входит:</..."))
299 } elseif ( isset( $this->tVars['parent_id'] ) AND $this->tVars['parent_id'] == 75 ) {
300 $this->renderPartial( '/includes/credit_models', array( 'content' => $content ) );
301 } elseif ( ( isset( $this->tVars['values']['set_id'] ) AND $this->tVars['values']['set_id'] == 2 ) OR ( isset( $this->tVars['parentValues']['set_id'] ) AND $this->tVars['parentValues']['set_id'] == 2 ) ) {
302 $this->renderPartial( '/includes/newCars/index', array( 'content' => $content ) );
303 } elseif ( ( isset( $this->tVars['values']['set_id'] ) AND $this->tVars['values']['set_id'] == 4 ) OR ( isset( $this->tVars['parentValues']['set_id'] ) AND $this->tVars['parentValues']['set_id'] == 4 ) ) {
304 $this->renderPartial( '/includes/action', array( 'content' => $content ) );
305 } else { ?>
306 <div class="row">
307 <div class="col-xs-12" class="middleContent innerContent">
308 <h1><?php echo $this->tVars['name']; ?></h1>
309 <?php echo $content; ?>

#4
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CBaseController.php(127): require("/var/www/user118605/data/www/s118605.smrtp.ru/themes/classic/vie...")
122 $data=$_data_;
123 if($_return_)
124 {
125 ob_start();
126 ob_implicit_flush(false);
127 require($_viewFile_);
128 return ob_get_clean();
129 }
130 else
131 require($_viewFile_);
132 }

#5
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CBaseController.php(96): CBaseController->renderInternal("/var/www/user118605/data/www/s118605.smrtp.ru/themes/classic/vie...", array("content" => "<p>В услугу Сезонный сервис входит:</..."), true)
091 {
092 $widgetCount=count($this->_widgetStack);
093 if(($renderer=Yii::app()->getViewRenderer())!==null && $renderer->fileExtension==='.'.CFileHelper::getExtension($viewFile))
094 $content=$renderer->renderFile($this,$viewFile,$data,$return);
095 else
096 $content=$this->renderInternal($viewFile,$data,$return);
097 if(count($this->_widgetStack)===$widgetCount)
098 return $content;
099 else
100 {
101 $widget=end($this->_widgetStack);

#6
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(785): CBaseController->renderFile("/var/www/user118605/data/www/s118605.smrtp.ru/themes/classic/vie...", array("content" => "<p>В услугу Сезонный сервис входит:</..."), true)
780 {
781 if($this->beforeRender($view))
782 {
783 $output=$this->renderPartial($view,$data,true);
784 if(($layoutFile=$this->getLayoutFile($this->layout))!==false)
785 $output=$this->renderFile($layoutFile,array('content'=>$output),true);
786
787 $this->afterRender($view,$output);
788
789 $output=$this->processOutput($output);
790

#7
– /var/www/user118605/data/www/s118605.smrtp.ru/protected/controllers/SiteController.php(161): CController->render("index", array("model" => Content))
156 if ($model === null)
157 {
158 throw new CHttpException(404, self::ERROR_404);
159 }
160
161 $this->render('index', array('model'=>$model));
162
163 if($available == '0' AND $ipCheck === TRUE){
164 $this->renderSystem('//global/offline-hint');
165 }
166

#8
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/actions/CInlineAction.php(50): SiteController->actionIndex()
45 $controller=$this->getController();
46 $method=new ReflectionMethod($controller, $methodName);
47 if($method->getNumberOfParameters()>0)
48 return $this->runWithParamsInternal($controller, $method, $params);
49 else
50 return $controller->$methodName();
51 }
52
53 }

#9
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(309): CInlineAction->runWithParams(array())
304 {
305 $priorAction=$this->_action;
306 $this->_action=$action;
307 if($this->beforeAction($action))
308 {
309 if($action->runWithParams($this->getActionParams())===false)
310 $this->invalidActionParams($action);
311 else
312 $this->afterAction($action);
313 }
314 $this->_action=$priorAction;

#10
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(287): CController->runAction(CInlineAction)
282 * @see runAction
283 */
284 public function runActionWithFilters($action,$filters)
285 {
286 if(empty($filters))
287 $this->runAction($action);
288 else
289 {
290 $priorAction=$this->_action;
291 $this->_action=$action;
292 CFilterChain::create($this,$action,$filters)->run();

#11
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(266): CController->runActionWithFilters(CInlineAction, array())
261 {
262 if(($parent=$this->getModule())===null)
263 $parent=Yii::app();
264 if($parent->beforeControllerAction($this,$action))
265 {
266 $this->runActionWithFilters($action,$this->filters());
267 $parent->afterControllerAction($this,$action);
268 }
269 }
270 else
271 $this->missingAction($actionID);

#12
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CWebApplication.php(276): CController->run("")
271 {
272 list($controller,$actionID)=$ca;
273 $oldController=$this->_controller;
274 $this->_controller=$controller;
275 $controller->init();
276 $controller->run($actionID);
277 $this->_controller=$oldController;
278 }
279 else
280 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
281 array('{route}'=>$route===''?$this->defaultController:$route)));

#13
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CWebApplication.php(135): CWebApplication->runController("")
130 foreach(array_splice($this->catchAllRequest,1) as $name=>$value)
131 $_GET[$name]=$value;
132 }
133 else
134 $route=$this->getUrlManager()->parseUrl($this->getRequest());
135 $this->runController($route);
136 }
137
138 /**
139 * Registers the core application components.
140 * This method overrides the parent implementation by registering additional core components.

#14
– /var/www/user118605/data/www/s118605.smrtp.ru/framework/base/CApplication.php(162): CWebApplication->processRequest()
157 */
158 public function run()
159 {
160 if($this->hasEventHandler('onBeginRequest'))
161 $this->onBeginRequest(new CEvent($this));
162 $this->processRequest();
163 if($this->hasEventHandler('onEndRequest'))
164 $this->onEndRequest(new CEvent($this));
165 }
166
167 /**

#15
– /var/www/user118605/data/www/s118605.smrtp.ru/index.php(16): CApplication->run()
11 defined('YII_DEBUG') or define('YII_DEBUG', true);
12 // specify how many levels of call stack should be shown in each log message
13 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
14
15 require_once($yii);
16 Yii::createWebApplication($config)->run();
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
16.11.2018, 20:48
Ответы с готовыми решениями:

Ошибка Undefined index =(
Добрый день всем! у меня такая проблема возникла выдает ошибку! Notice: Undefined index:...

Ошибка Undefined index
У меня есть код php который запрашивает у глобального массив $_GET - ячейку id - но ее нету - и это...

Ошибка Undefined index
Здравствуйте! Не можете подсказать, почему PHP &quot;ругается&quot; на эти 6 строк? $year = $_POST ; $month...

Ошибка Undefined index:
Notice: Undefined index: b_tech_id in...

2
6 / 7 / 0
Регистрация: 13.10.2010
Сообщений: 159
16.11.2018, 21:12 2
Undefined index - это не ошибка, а notice

Можно либо в настройках сервера скрыть, либо, что правильнее - обработать через isset()

т.е. вывод $this->tVars['text'] вставить:

PHP
1
2
3
4
if( isset($this->tVars['text']) )
{
echo $this->tVars['text'];
}
1
0 / 0 / 0
Регистрация: 16.11.2018
Сообщений: 4
16.11.2018, 23:46  [ТС] 3
Сделал как Вы сказали, теперь страница открылась, но появился код:
{
echo $this->tVars['text'];
}

В итоге я вообще удалил строчку <p><?php echo $this->tVars['text']; ?></p> и все работает. Правда некоторые фото перестали грузиться)
0
16.11.2018, 23:46
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
16.11.2018, 23:46
Помогаю со студенческими работами здесь

Ошибка - Notice: Undefined index
Приветствую:) есть форма для регистрации и авторизации. Регистрация работает, а вот с авторизацией...

Ошибка Notice: Undefined index:
Помогите пожалуйста, у меня форма обратной связи выдает вот такие ошибки: Notice: Undefined...

Ошибка Undefined index: key in
Помогите пожл убрать ошибку: PHP Notice: Undefined index: key in /zakazform/php/go.php on line...

Ошибка Notice: Undefined index
Здравствуйте. Возникла проблема с работой сессии. На последний сборке денвера все работает, а на...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
3
Ответ Создать тему
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru