• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal error -> base_url() - what am I doing wrong?

#11
[eluser]ICEcoffee[/eluser]
thanks guys, I'm going to use both of those suggestions.

I'm grateful for the active community surrounding CI.

#12
[eluser]ICEcoffee[/eluser]
this may be obvious to the experienced CI coder, but I learned this works:

Quote:<link rel='stylesheet' href='<?php echo base_url() . "styles/style.css"; ?>' type='text/css' media='screen' charset='utf-8' />

and this doesn't:
Quote:<link rel='stylesheet' href='<?php echo base_url("styles/style.css"); ?>' type='text/css' media='screen' charset='utf-8' />

ie the difference of using base_url() and site_url() in the context above.

The reason base_url() - as used above - doesn't work, is because it adds 'index.php' into the href path, which for me, doesn't work. the browser output is:
Quote:<link rel='stylesheet' href='http://localhost/ci2/index.php/styles/style.css' type='text/css' media='screen' charset='utf-8' />

I hope this makes sense.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.