• Web Design and Development Blog - Rochester MN

  • blog » home

Writing PHP for distribution

December 21st, 2008 · No Comments

If your unsure of what server your php applications are going to be running on, you should be writing code that doesn’t assume your server is running short tags etc. For example you can write your php blocks using the short tag version like below:

Short tags: <? ?>

However you should be writing your code like this: <?php ?>

This will ensure that you will not have to edit the php blocks to display on a server that does not have “short tags” enabled.

Another best practice programming model to take when passing variables across pages is to use $_POST["var_name"] or $_GET["var_name"]rather than using $var_name. Not all servers have the ability to understand when a variable is being passed across pages without the use of $_POST or $_GET. This will also make it easier on you to know what is going on in your code when go back to edit later.

As always be sure to practice what you read.

~RDS

Tags: Coding

Web Design Blogs - BlogCatalog Blog Directory
Minnesota Yellow Pages

Find us on Facebook

Follow us on Twitter

Recent Posts

Site Launch: Heartman Insurance
We are proud to announce the launch of Heartman Insurance, a full service independent insurance agency headquartered in Rochester, MN. We worked closely with the Heartman staff...

View Full Blog »

Contact Us Today

Bookmark Us!