View not executing PHP code |
[eluser]HooJee[/eluser]
Hi Guys I cannot execute PHP code in my view files. The controllers on the other hand work perfectly fine. I am using WAMP 2.0
[eluser]kgill[/eluser]
It would be helpful to see the code in the view and the controller, also are you getting any error messages? If you want help you have to give us a little more info.
[eluser]HooJee[/eluser]
The code is pretty straightforward. See below: // home.php controller Code: <?php //homeview.php Code: <?xml version="1.0" encoding="utf-8"?>
[eluser]wabu[/eluser]
Is short_open_tag enabled in php.ini (http://us3.php.net/manual/en/ini.core.php)? You might try using "<?php" in your template first to see if that works.
[eluser]HooJee[/eluser]
Oh yes! Silly me, how could I forget. BTW, I have noticed people do the following to get the base url: <?=base_url?> Whenever I try it I get a blank. It'll only work if I use echo. Do you know why this could be happening?
[eluser]jayrulez[/eluser]
[quote author="HooJee" date="1248563896"]Oh yes! Silly me, how could I forget. BTW, I have noticed people do the following to get the base url: <?=base_url?> Whenever I try it I get a blank. It'll only work if I use echo. Do you know why this could be happening?[/quote] for d same reason above |
Welcome Guest, Not a member yet? Register Sign In |