Welcome Guest, Not a member yet? Register   Sign In
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.




Theme © iAndrew 2016 - Forum software by © MyBB