CodeIgniter Forums
define base_url() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: define base_url() (/thread-64882.html)



define base_url() - davy_yg - 04-06-2016

How to define base_url();

I am trying to define base_url ( ) ;

Any idea how to?

Instead of www.website.com I would like localhost/website/

for example - any clue?

Thanks in advance.


RE: define base_url() - Narf - 04-07-2016

Here's a webpage full of clues: https://codeigniter.com/userguide3/


RE: define base_url() - davy_yg - 04-07-2016

Okay looks good!  Now, I am trying to post this:

views/cms/index.php


PHP Code:
<link href"<?php echo base_url();?>style.css" rel="stylesheet" type="text/css" media="screen">
<
script src="js/jquery.min.js" type="text/javascript"></script>
<
script src="js/chili-1.7.pack.js"></script>
<
script src="js/jquery.cycle.all.js" type="text/javascript"></script>
<
script src="js/jquery.easing.1.3.js" type="text/javascript" ></script

I am trying to make style.css works!  I wonder why my style.css does not work.


RE: define base_url() - EricP - 04-07-2016

(04-07-2016, 01:39 AM)davy_yg Wrote: Okay looks good!  Now, I am trying to post this:

views/cms/index.php


PHP Code:
<link href"<?php echo base_url();?>style.css" rel="stylesheet" type="text/css" media="screen">
<
script src="js/jquery.min.js" type="text/javascript"></script>
<
script src="js/chili-1.7.pack.js"></script>
<
script src="js/jquery.cycle.all.js" type="text/javascript"></script>
<
script src="js/jquery.easing.1.3.js" type="text/javascript" ></script

I am trying to make style.css works!  I wonder why my style.css does not work.
If your css files are in de folder /css then try:

PHP Code:
echo base_url().'css/style.css'



RE: define base_url() - jaynarayan - 04-07-2016

echo base_url('css/style.css');