localhost --> website looks chaos - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: localhost --> website looks chaos (/showthread.php?tid=65635) |
localhost --> website looks chaos - davy_yg - 07-04-2016 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"> views/index.php PHP Code: <!DOCTYPE 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. RE: localhost --> website looks chaos - nalletje - 07-05-2016 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. RE: localhost --> website looks chaos - davy_yg - 07-05-2016 Hello, This is my last code revision config/config.php PHP Code: $config['base_url'] = 'http://localhost/CompanyGiondaCI/'; views/index.php PHP Code: <head> 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? RE: localhost --> website looks chaos - arma7x - 07-06-2016 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 { RE: localhost --> website looks chaos - InsiteFX - 07-06-2016 He's linkiing in the html to site_url() which displays index.php he needs to change all site_url's to base_url(). RE: localhost --> website looks chaos - davy_yg - 07-06-2016 Where can I find site_url() in my file? I can only find base_url() in the config.php RE: localhost --> website looks chaos - InsiteFX - 07-06-2016 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> |