CodeIgniter Forums

Full Version: define base_url()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Here's a webpage full of clues: https://codeigniter.com/userguide3/
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.
(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'
echo base_url('css/style.css');