CSS not loaded |
[eluser]pabloc[/eluser]
hi everyone. I need some help, couse coudn´t found in web sites. I have this web structure: CI - application -controllers * auth.php - view * footer.php * header.php - app - ion_auth - website * register.php - css - font - img - js -system The register.php has something like this: <?php echo form_open("auth/create_user"); echo form_input('first_name','',$value_input); echo form_password('password','',$value_input);?> <button type="submit" class="btn btn-primary">Register<i class="icon-white icon-arrow-right"></i></button> <?php echo form_close();?> The auth/create_user end of function is just like this: this->_render_page('auth/create_user', $this->data); But I changed this line with the next ones: $this->load->view('header'); $this->load->view('web/register',$this->data); $this->load->view('footer'); Web page load is ok, bu CSS /JS in header/footer isn't loading!, here's the problem. hope somebody can help! thanks! Pablo
[eluser]PravinS[/eluser]
can you please check css and js file path in view source and let us know
[eluser]anis2505[/eluser]
How do you include the css/js files. are you hardcoding their paths or are you using built-in function such site_url and base_url to do the job.
[eluser]pabloc[/eluser]
Hi everyone! CSS´s are included in the header.php just like this: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" c initial-scale=1.0"> <meta name="description" c> <meta name="author" c > <title>MySite</title> <link href="<?php base_url()?>css/bootstrap.min.css" rel="stylesheet"> <link href="<?php base_url()?>css/bootstrap-responsive.min.css" rel="stylesheet"> <link href="<?php base_url()?>css/font-awesome.css" rel="stylesheet"> <link href="<?php base_url()?>css/font-awesome-ie7.css" rel="stylesheet"> <link href="<?php base_url()?>css/boot-business.css" rel="stylesheet"> </head> that's what you are asking? Regards! Pablo
[eluser]anis2505[/eluser]
[quote author="pabloc" date="1371212728"]Hi everyone! CSS´s are included in the header.php just like this: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" c initial-scale=1.0"> <meta name="description" c> <meta name="author" c > <title>MySite</title> <link href="<?php base_url()?>css/bootstrap.min.css" rel="stylesheet"> <link href="<?php base_url()?>css/bootstrap-responsive.min.css" rel="stylesheet"> <link href="<?php base_url()?>css/font-awesome.css" rel="stylesheet"> <link href="<?php base_url()?>css/font-awesome-ie7.css" rel="stylesheet"> <link href="<?php base_url()?>css/boot-business.css" rel="stylesheet"> </head> that's what you are asking? Regards! Pablo[/quote] Ok just make sure that on the config file base_url starts by "http://"
[eluser]anis2505[/eluser]
[quote author="pabloc" date="1371218229"]Yes, base_url() = http://127.0.0.1/mywebsite/ Pablo[/quote] Ok one extra thing if you are using apache remove the .htaccess file if you are using one and try again. sometimes apache behave stragely
[eluser]pabloc[/eluser]
mmmmmmmmmmmmm...... I think... you got it !!! I removed .htaccess (use it because i eliminate index.php from url). And... and... all website behavior is the same when CSS/JS problems occurs! I don´t know if its usefull but, here's the .htaccess code: RewriteEngine on RewriteCond $1 !^(index.php|css|font|img|js|public|robots.txt) RewriteRule ^(.*)$ /mycodeigniterwebsite/index.php/$1 [L] Pablo
[eluser]anis2505[/eluser]
[quote author="pabloc" date="1371219750"]mmmmmmmmmmmmm...... I think... you got it !!! I removed .htaccess (use it because i eliminate index.php from url). And... and... all website behavior is the same when CSS/JS problems occurs! I don´t know if its usefull but, here's the .htaccess code: RewriteEngine on RewriteCond $1 !^(index.php|css|font|img|js|public|robots.txt) RewriteRule ^(.*)$ /mycodeigniterwebsite/index.php/$1 [L] Pablo [/quote] It's not working for me. I guess you have to dig further to get the best configuration. One advise work build your application and at the end think about cleaning the urls regards
[eluser]pabloc[/eluser]
Ok anis2505 All your answers were very helpfull! Best regards! |
Welcome Guest, Not a member yet? Register Sign In |