I am getting <? for all instances of where I expect the PHP to be. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: I am getting <? for all instances of where I expect the PHP to be. (/showthread.php?tid=55899) |
I am getting <? for all instances of where I expect the PHP to be. - El Forum - 11-15-2012 [eluser]Unknown[/eluser] Hi All. I recently took an already existing codeigniter site off my hosting provider to my localhost. I have correctly changed the database.php file (or at least I don't have any reported problems). I checked the Logs folder but there is only an index.html file there. For instance the <title> I am getting from the page source looks like this Code: <title><?= $meta_title; ?></title> It should of course render to Code: <title>A nice Page </title> Even built in items such as Code: <?= base_url() ?> Code: <?= base_url() ?>resources/css/reset.css I downloaded a fresh copy of codeigniter from the codeigniter site, and codeigniter works as expected, so something is amiss with the existing site I downloaded. Dose anyone have any ideas what causes the <? to render instead of the intended php code ? Thanks a mill, Daragh I am getting <? for all instances of where I expect the PHP to be. - El Forum - 11-15-2012 [eluser]Mirge[/eluser] Check your application/config/config.php file. $config['global_xss_filtering'] = TRUE; If it's set to TRUE, that is the behavior. Try setting it to FALSE. I am getting <? for all instances of where I expect the PHP to be. - El Forum - 11-15-2012 [eluser]PhilTem[/eluser] It is most likely a configuration issue of your webserver. Some configurations allow using Code: <?= $meta_title ?> to automatically echo the succeeding variable, some environments require you to write Code: <?php echo $meta_title; ?> Plus: Is your fileextension .php or anything else? If it's not .php it will not be parsed by the PHP interpreter thus the command <?= is unknown. However, you should not be having any other fileextension but .php when working with CI (except .htaccess) I am getting <? for all instances of where I expect the PHP to be. - El Forum - 11-15-2012 [eluser]CroNiX[/eluser] There is a config setting for that regardless of whether the server supports php short tags (<? instead of <?php) Code: $config['rewrite_short_tags'] = TRUE; I am getting <? for all instances of where I expect the PHP to be. - El Forum - 11-16-2012 [eluser]Unknown[/eluser] Hi All, It was the Code: $config['rewrite_short_tags'] = TRUE; |