|
-
Nov 20th, 2006, 05:58 AM
#1
Thread Starter
New Member
Ssi Or Php
As a newbie to both these challenges, would there be any great advantage in choosing one or the other?
At the moment I would just want to 'include' certain sections of my pages (menus, footers etc), but in the future who knows??
Are they just as easy/difficult to learn and code?"
-
Nov 20th, 2006, 08:26 AM
#2
Re: Ssi Or Php
Neither are difficult. Here is an outline of the advantages and disadvantages of both. Your situation will determine the best choice:
SSI's
Advantages
- Fast - Substitutions are made by the server as the page is loading and cached where possible. So it can be as fast as serving a static HTML file.
- Execution of CGI scripts - SSI's can like PHP scripts be dynamic. You can include the output from one or more CGI scripts within the HTML document. This can include a PHP script (when PHP is configured as a CGI).
- Simple conditionals - You can conditionally display or not display content based on certain conditions. This to a degree makes SSI's Dynamic too.
Disadvantages
- Not all web servers support SSI. In fact the only web server I know that does support it is Apache. This means you cannot gauruntee your pages will port to a different server.
- Other than conditionals, there is no other display logic control, such as iteration constructs and mutually exclusive constructs.
- Data handling and processing is limited to being able to read and set environment variables only.
PHP
Advantages
- PHP is a server side an interpreted server side programming language. It contains a multitude of functions, operators, extensions and data access components that enable you to change, store and modify data anyway you please.
- PHP contains all the necessary programming constructs that may be required when display HTML and as well as acting as an Object Orientated platform, it can also act as a template language that can be embedded inside HTML.
- You can access files and databases from within a PHP script.
- A PHP script can be written and executed on any server that has PHP installed on both Windows, Mac and UNIX. This can potentially be any web server that supports the CGI specification as PHP is able to run as a CGI interpreter.
Disadvantages
- Sending an HTML page through the PHP interpreter is slower than serving a static HTML page and uses more of the servers processing resources. PHP can be run as a module on some web servers. This greatly increases the speed, as the interpreter is only loaded in to memory once - it is still however, slower than static HTML pages.
- Power can be dangerous - PHP gives you an enormous amount of power. However, iit is very easy and tempting, especially when knocking something up quickly (which PHP makes it very easy to do) to neglect basic security and coding standards.
- You must install PHP on the web server you wish to use it on. The majority of hosting companies offer PHP. For a testing environment at home, you need to download Apache and PHP (Mysql if you require a database) and configure them, for your scripts to work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|