James C. Posted February 17, 2010 Share Posted February 17, 2010 I have a set of PHP templates that use the following code to generate a page title: <title><?=getSetting('page_title');?></title> The code works on about 99% of servers. For some reason on FC11 servers only, the above code works, but only on certain pages. There is no difference between the pages that do work and don't. It's a very unusual behavior and something I've been trying to figure out for months. I'm not sure if it's a PHP setting or a LINUX setting. Either or, if I'm using CentOS, RHEL or Fedora, PHP & Apache configuration files are identical with identical versions as well. Any help would be appreciated, James C. Quote Link to comment https://forums.phpfreaks.com/topic/192372-php-getsetting/ Share on other sites More sharing options...
trq Posted February 17, 2010 Share Posted February 17, 2010 Your using short open tags which can lead to issues with compatibility. <title><?php echo getSetting('page_title');?></title> Quote Link to comment https://forums.phpfreaks.com/topic/192372-php-getsetting/#findComment-1013666 Share on other sites More sharing options...
James C. Posted February 17, 2010 Author Share Posted February 17, 2010 Is there some work-around for it that should make that compatible on all distros? Your using short open tags which can lead to issues with compatibility. <title><?php echo getSetting('page_title');?></title> Quote Link to comment https://forums.phpfreaks.com/topic/192372-php-getsetting/#findComment-1013672 Share on other sites More sharing options...
trq Posted February 17, 2010 Share Posted February 17, 2010 Is there some work-around for it that should make that compatible on all distros? Your using short open tags which can lead to issues with compatibility. <title><?php echo getSetting('page_title');?></title> Yes, I just showed you. Proper coding is the best option. You could turn on short_open_tags in any of php's config options (php.ini, .htaccess, ini_set) though I would recommend fixing the code to be guarantied compatible. Quote Link to comment https://forums.phpfreaks.com/topic/192372-php-getsetting/#findComment-1013675 Share on other sites More sharing options...
James C. Posted February 17, 2010 Author Share Posted February 17, 2010 The funny thing is short_open_tags is enabled and I still have the issue. For the specific pages that don't work, I'll go ahead and replace the code. Thank you. Is there some work-around for it that should make that compatible on all distros? Your using short open tags which can lead to issues with compatibility. <title><?php echo getSetting('page_title');?></title> Yes, I just showed you. Proper coding is the best option. You could turn on short_open_tags in any of php's config options (php.ini, .htaccess, ini_set) though I would recommend fixing the code to be guarantied compatible. Quote Link to comment https://forums.phpfreaks.com/topic/192372-php-getsetting/#findComment-1013677 Share on other sites More sharing options...
trq Posted February 17, 2010 Share Posted February 17, 2010 Maybe its something to do with the getSetting() function then. Wouldn't know though without seeing it. Quote Link to comment https://forums.phpfreaks.com/topic/192372-php-getsetting/#findComment-1013678 Share on other sites More sharing options...
PFMaBiSmAd Posted February 17, 2010 Share Posted February 17, 2010 The funny thing is short_open_tags is enabled and I still have the issue Which is yet another reason why you should write code that will work on all server configurations by not relying on any of the lazy-way (save typing a few characters in a file) short-cuts. People keep wasting hours and sometimes days of time when code is moved to a different server because someone tried to save a minute of typing time. That equates to wasting 2-3 orders of magnitude more time troubleshooting a problem every time you move to a server that does not have short_open_tags enable then was ever saved in typing type. Simply amazing. Quote Link to comment https://forums.phpfreaks.com/topic/192372-php-getsetting/#findComment-1013686 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.