CodeIgniter Forums

Full Version: localhost --> website looks chaos
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

My website only looks good if I type this url:  http://127.0.0.1/CompanyGiondaCI/index.php/cpages/index

I wonder why it looks so bad if I type this url:  http://127.0.0.1/CompanyGiondaCI/



views/navigation.php


PHP Code:
<div id="sidebar"


        <h1 id="logo"><a href="index.php">Free Admin</a></h1 
        
<a href="#" class="visible-phone"><class="icon icon-home"></iDashboard</a>
        <ul>
            <li class="active"><a href="<?php echo site_url('cpages/index'); ?>"><class="icon icon-home"></i> <span>Administrator</span></a></li>
            <li class="submenu">
                <a href="<?php echo site_url('cpages/categories'); ?>"><class="icon icon-th-list"></i> <span>Categories</span> <span class="label">2</span></a>
                <ul>
                    <li><a href="<?php echo site_url('cpages/pcategories'); ?>">Parent categories</a></li>
                    <li><a href="<?php echo site_url('cpages/scategories'); ?>">Sub Categories</a></li>
                </ul>
            </li>
            <li><a href="<?php echo site_url('cpages/pages'); ?>"><class="icon icon-tint"></i> <span>Pages</span></a></li>
            <li><a href="<?php echo site_url('cpages/slideshows'); ?>"><class="icon icon-pencil"></i> <span>Slideshows</span></a></li>
            <li><a href="<?php echo site_url('cpages/contents'); ?>"><class="icon icon-th"></i> <span>Contents</span></a></li>
            <li><a href="<?php echo site_url('cpages/galleries'); ?>"><class="icon icon-th-list"></i> <span>Galleries</span></a></li>
            <li><a href="<?php echo site_url('cpages/newsletters'); ?>"><class="icon icon-th-list"></i><span>Newsletters</span></a></li>            
            
<li class="submenu">
                <a href="#"><class="icon icon-file"></i> <span>Administrators</span><span class="label">2</span></a>
                <ul>
                    <li><a href="<?php echo site_url('cpages/users'); ?>">Users</a></li>
                    <li><a href="<?php echo site_url('cpages/roles'); ?>">Roles</a></li>                    
                
</ul>
            </li>
            <li><a href="<?php echo site_url('cpages/settings'); ?>"><class="icon icon-th-list"></i> <span>Settings</span></a></li>
            <li>
                <a href="#"><class="icon icon-inbox"></i> <span>Logout</span></a>
            </li>
        </ul>
    </div




views/index.php

PHP Code:
<!DOCTYPE html>
<
html lang="en">
    <head>
        <title>Gionda CMS</title>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <link rel="stylesheet/less" type="text/css" href="<?php echo base_url(); ?>assets/themes/less/bootstrap.less">
        <script src="<?php echo base_url(); ?>assets/themes/js/less/less.js" type="text/javascript"></script>
        <link rel="stylesheet" href="<?php echo base_url(); ?>assets/themes/style/fullcalendar.css" />    

        <link rel="stylesheet" href="<?php echo base_url(); ?>assets/themes/style/delta.main.css" />
        <link rel="stylesheet" href="<?php echo base_url(); ?>assets/themes/style/delta.grey.css"/>
        
        <link rel="stylesheet" href="<?php echo base_url(); ?>assets/themes/style/add.css"/>
        
    </head>
    <body>
    <br>
    
    <?php include('navigation.php'); ?>
    
      <div id="mainBody">
            <h1>COMPANY PROFILE CMS
                <div class="pull-right">
                <a class="btn btn-large tip-bottom" title="Manage Users"><i class="icon-user"></i></a>
                <a class="btn btn-large tip-bottom" title="Manage Comments" style="position:relative"><i class="icon-comment"></i>
                <span style="position:absolute; border-radius:12px; top:-23%; height:16px; width:16px" class="label label-important">5</span></a>
                <a class="btn btn-large tip-bottom" title="Manage Orders"><i class="icon-shopping-cart"></i></a>
                <a class="btn btn-large btn-danger" title="" href="#"><i class="icon-off"></i></a>
                </div>
            </h1>
        <div id="breadcrumb">
            <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a>
            <a href="#" class="current">Dashboard</a>
        </div>
        
            <div class="row-fluid">
                <div class="span12">
                    
                    <button type="button" class="add" href="adminform.php">ADD ADMINISTRATOR</button> 
                    
                    <div class="widget-box">
                        <div class="widget-title"><h5>Administrator</h5></div>
                        <div class="widget-content">
                        
                        <table border="0" style="width: 100%; height: 90px;">
                            <tr>
                                <td>NAME</td>
                                <td>EMAIL</td>
                                <td>ROLE</td>
                                <td>EDIT</td>
                                <td>DELETE</td>    
                            </td>
                            <tr>
                                <td>Victor</td>
                                <td>victor@mail.com</td>
                                <td>Administrator</td>
                                <td><button type="button" class="edit" href="adminform.php">EDIT</button></td>
                                <td><button type="button" class="delete" href="adminform.php">DELETE</button></td>    
                            </td>    
                            <tr>
                                <td>David</td>
                                <td>david@mail.com</td>
                                <td>Manager</td>
                                <td><button type="button" class="edit" href="adminform.php">EDIT</button></td>
                                <td><button type="button" class="delete" href="adminform.php">DELETE</button></td>    
                            </td>    
                        </table>            
                        </div>
                    </div>                    
                </div>
            </div>
            
            
        </div>
        </div>

            <script src="<?php echo base_url(); ?>assets/themes/js/excanvas.min.js"></script>
            <script src="<?php echo base_url(); ?>assets/themes/js/jquery.min.js"></script>
            <script src="<?php echo base_url(); ?>assets/themes/js/jquery.ui.custom.js"></script>
            <script src="<?php echo base_url(); ?>assets/themes/js/bootstrap.min.js"></script>
            <script src="<?php echo base_url(); ?>assets/themes/js/jquery.flot.min.js"></script>
            <script src="<?php echo base_url(); ?>assets/themes/js/jquery.flot.resize.min.js"></script>
            <script src="<?php echo base_url(); ?>assets/themes/js/jquery.peity.min.js"></script>
            <script src="<?php echo base_url(); ?>assets/themes/js/fullcalendar.min.js"></script>
            <script src="<?php echo base_url(); ?>assets/themes/js/delta.js"></script>
            <script src="<?php echo base_url(); ?>assets/themes/js/delta.dashboard.js"></script>
    </body>
</html> 


I wonder why the view with this:   http://localhost/CompanyGiondaCI/  (This one looks a little bit chaos - I wonder why?  )

and this: http://127.0.0.1/CompanyGiondaCI/  (This is one looks better)

looks difference.  Can anyone help me fix this website so that it looks better?  Thanks in advance.
Try to use the browser console, i think he can not find the correct paths.

Try adding:
<base href="<?PHP echo base_url(); ?>" />

After the:
<head> tag

(And offcouse make sure you filled in $config['base_url'] in the application/config/config.php )


You also might change the paths to the files.
Hello,

This is my last code revision


config/config.php


PHP Code:
$config['base_url'] = 'http://localhost/CompanyGiondaCI/'



views/index.php


PHP Code:
<head>
    <
base href="<?PHP echo base_url(); ?>" /> 
I have this error message appearing :
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Mpages::$load
Filename: libraries/Form_validation.php
Line Number: 147
Backtrace:
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\models\mpages.php
Line: 10
Function: __construct
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\controllers\cpages.php
Line: 32
Function: model
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\index.php
Line: 315
Function: require_once

Fatal error: Call to a member function helper() on null in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\system\libraries\Form_validation.php on line 147
A PHP Error was encountered
Severity: Error
Message: Call to a member function helper() on null
Filename: libraries/Form_validation.php
Line Number: 147
Backtrace:

Any idea how to fix it?
Model filename should be Ucfirst, Mpages.php not mpages.php and, the class name should be Ucfirst too.

Mpages.php
PHP Code:
class Mpages extends CI_Model {

    public function 
__construct()
    {
        
parent::__construct();
        
        
$this->load->database();        
    } 

He's linkiing in the html to site_url() which displays index.php he needs to change all site_url's to base_url().
Where can I find site_url() in my file? I can only find base_url() in the config.php
It's in your view html file but in CI site_url is in the url_helper

Also any javascript should be the lastr lines in your html <head></head> section
If you do not need the document ready place your javascript files at the end of your html file
so that your pages load faster.


<!-- javascript here -->

</body>
</html>