CodeIgniter and PHP

[eluser]Blues Clues[/eluser]
I am exploring CI and PHP and wondering if I could include PHP code snippets in <head> tag of HTML code...

for example, I have the following code in <head>.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
&lt;html &gt;
&lt;?php echo base_url(); ?&gt;

<li><a href="#">Home</a></li>

Any thoughts as to why I would not get any results. My page is blank.


You have to load the URL helper in order to use it's functions.

[eluser]Blues Clues[/eluser]
I already have the following stmt in my autoload.php

$autoload['helper'] = array('url');

Should I have something more added in addition to this?

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>
&lt;html &gt; wrong you have a space here

it should be this
&lt;html xmlns=""&gt;

&lt;?php echo base_url(); ?&gt; this will only showup in source view not on screen

no ending &lt;/html&gt; tag

Also this I hope you are displaying in a view file.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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