Jump to content

PHP getSetting


James C.

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/192372-php-getsetting/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/192372-php-getsetting/#findComment-1013675
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/192372-php-getsetting/#findComment-1013677
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/192372-php-getsetting/#findComment-1013686
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.