Welcome Guest, Not a member yet? Register   Sign In
Fatal error -> base_url() - what am I doing wrong?
#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.


Messages In This Thread
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 10:35 AM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 10:46 AM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 11:15 AM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 11:34 AM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 11:39 AM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 11:50 AM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 12:01 PM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 01:43 PM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 03:20 PM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-10-2008, 05:53 PM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-11-2008, 12:56 AM
Fatal error -> base_url() - what am I doing wrong? - by El Forum - 06-11-2008, 02:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB