PHP code within a plugin
I have some php code <? echo date('Y'); ?> in a plugin for the footer. The text is showing before the code but not the code. I also put the code on the page and it doesn't work there either.
I have some php code <? echo date('Y'); ?> in a plugin for the footer. The text is showing before the code but not the code. I also put the code on the page and it doesn't work there either.
I'll need to troubleshoot directly, see the private message section.
When I transferred the site over to a live webserver it seems to be working fine now. I will have to try and figure out what is wrong with my local server that it is not showing up there.
ok. glad to hear it is working on the live site.
Sorry to jump in, but I may be able to help with this one.
Is that the actual code you are using for PHP? Using "<?" to open a PHP block is a shortcut, and the server needs to be configured to read that....You would need to have PHP Short Tags enabled in your PHP INI file on your local server for that to work.
I would recommend not using short tags. You already found out why - they don't always work the same on differently configured servers. Use the FULL PHP Tag to open a PHP block "<?php"... Any PHP system can read that one and it's only 3 more characters...
Just my 2 cents...
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.