• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undefined variable

#1
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: css_files
Filename: views/galleries_add.php
Line Number: 51
Backtrace:
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\views\galleries_add.php
Line: 51
Function: _error_handler
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 135
Function: view
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once

A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: views/galleries_add.php
Line Number: 51
Backtrace:
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\views\galleries_add.php
Line: 51
Function: _error_handler
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 135
Function: view
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: js_files
Filename: views/galleries_add.php
Line Number: 55
Backtrace:
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\views\galleries_add.php
Line: 55
Function: _error_handler
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 135
Function: view
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once

A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: views/galleries_add.php
Line Number: 55
Backtrace:
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\views\galleries_add.php
Line: 55
Function: _error_handler
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 135
Function: view
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once
Example 1 - Simple | Example 2 - Ordering | Example 3 - With group id | Example 4 - Images with title | Simple Photo Gallery
 
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: output
Filename: views/galleries_add.php
Line Number: 89
Backtrace:
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\views\galleries_add.php
Line: 89
Function: _error_handler
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 135
Function: view
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once




views/galleries_add.php


PHP Code:
<div class="widget-box">
                        <
div class="widget-title"><h5>Galleries</h5></div>
                        <
div class="widget-content">
                        
                        <?
php foreach($css_files as $file): ?>
                        <link type="text/css" rel="stylesheet" href="<?php echo $file?>" />
                        <?php endforeach; ?>

                        <?php foreach($js_files as $file): ?>
                        <script src="<?php echo $file?>"></script> 
                        <?php endforeach; ?>

                        <style type='text/css'>
                        body
                        {
                        font-family: Arial;
                        font-size: 14px;
                        }

                        a {
                        color: blue;
                        text-decoration: none;
                        font-size: 14px;
                        }

                        a:hover
                        {
                        text-decoration: underline;
                        }
                        </style>                    
                            
                        </div>
                        
                        <div>
                            <a href='<?php echo site_url('images_examples/example1')?>'>Example 1 - Simple</a> |
                            <a href='<?php echo site_url('images_examples/example2')?>'>Example 2 - Ordering</a> |
                            <a href='<?php echo site_url('images_examples/example3/22')?>'>Example 3 - With group id</a> |
                            <a href='<?php echo site_url('images_examples/example4')?>'>Example 4 - Images with title</a> | 
                            <a href='<?php echo site_url('images_examples/simple_photo_gallery')?>'>Simple Photo Gallery</a>
                        </div>
                        <div style='height:20px;'></div>  
                        <div>
                            <?php echo $output?>
                        </div>
                    </div> 




controllers/cpages.php

PHP Code:
public function addgalleries() {  $this->load->view('galleries_add');  



How to fix the errors?  Can anyone help me fix the error?
" If I looks more intelligence please increase my reputation."
Reply

#2
Dude! Go through a php tutorial and do some php studying!

Message: Undefined variable: css_files

Filename: views/galleries_add.php

Line Number: 51


You never defined the variable.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.