PDA

View Full Version : difference between a PHP and HTML


pnplawn
10-16-2007, 12:48 AM
PHP files are just like HTML files, but they can include both HTML and PHP code. The PHP code is parsed (or executed) by the Web server when the page is accessed and the resulting output is written as HTML within the Web page. When a user accesses a PHP page, his Web browser only gets sent the HTML code, since the Web server has processed the PHP code in the background. Most PHP pages are processed so quickly that it does not noticeably slow down the loading of the Web page.

The .php extension is important, since it tells the Web server that the page may include PHP code. Therefore, it must be run through the server's PHP engine before being sent to a client's Web browser. This allows dynamic content to be generated each time the Web page is loaded, based on the variables included in the PHP code. For example, PHP pages may load objects such as the current date and time, data from form fields submitted by a user, or information from a database. Still, once the page reaches the user's Web browser, everything is formatted as HTML.

Major Features of PHP

* Standard CGI, FastCGI and Apache module support - As a standard CGI program, PHP can be installed on any UNIX machine running any UNIX web server. With support for the new FastCGI standard, PHP can take advantage of the speed improvements gained through this mechanism. As an Apache module, PHP becomes an extremely powerful and lightning fast alternative to CGI programmimg.
* Access Logging - With the access logging capabilities of PHP, users can maintain their own hit counting and logging. It does not use the system's central access log files in any way, and it provides real-time access monitoring. The Log Viewer Script provides a quick summary of the accesses to a set of pages owned by an individual user. In addition to that, the package can be configured to generate a footer on every page which shows access information. See the bottom of this page for an example of this.
* Access Control - A built-in web-based configuration screen handles access control configuration. It is possible to create rules for all or some web pages owned by a certain person which place various restrictions on who can view these pages and how they will be viewed. Pages can be password protected, completely restricted, logging disabled and more based on the client's domain, browser, e-mail address or even the referring document.
* PostgresSQL Support - Postgres is an advanced free RDBMS. PHP supports embedding PostgreSQL "SQL queries" directly in .html files.
* RFC-1867 File Upload Support - File Upload is a new feature in Netscape 2.0. It lets users upload files to a web server. PHP provides the actual Mime decoding to make this work and also provides the additional framework to do something useful with the uploaded file once it has been received.
* HTTP-based authentication control - PHP can be used to create customized HTTP-based authentication mechanisms for the Apache web server.
* Variables, Arrays, Associative Arrays - PHP supports typed variables, arrays and even PERL-like associative arrays. These can all be passed from one web page to another using either GET or POST method forms.
* Conditionals, While Loops - PHP supports a full-featured C-like scripting language. You can have if/then/elseif/else/endif conditions as well as while loops and switch/case statements to guide the logical flow of how the html page should be displayed.
* Extended Regular Expressions - Regular expressions are heavily used for pattern matching, pattern substitutions and general string manipulation. PHP supports all common regular expression operations.
* Raw HTTP Header Control - The ability to have web pages send customized raw HTTP headers based on some condition is essential for high-level web site design. A frequent use is to send a Location: URL header to redirect the calling client to some other URL. It can also be used to turn off cacheing or manipulate the last update header of pages.
* On-the-fly GIF image creation - PHP has support for Thomas Boutell's GD image library which makes it possible to generate GIF images on the fly.
* ISP "Safe Mode" support - PHP supports an unique "Safe Mode" which makes it safe to have multiple users run PHP scripts on the same server.
* Many more new features are being added in newer releases of PHP. Visit the main web site at http://www.php.net
* It's Free! - One final essential feature. The package is completely free. It is licensed under the GNU/GPL which allows you to use the software for any purpose, commercial or otherwise.

pmblair
10-16-2007, 03:06 AM
Some of that was totally foreign to me.... I can only imagine what the HTML illiterate are thinking... lol .... gonna have to do some more research on this.... I never did understand PHP

anadyf
10-18-2007, 09:46 AM
That's great info buddy....
PHP is getting more and more popular due to it's high usability.
Following sites will help you to get your hands on PHP :
http://oopschool.com/
http://smartwebby.com/PHP/variable.asp
http://www.w3schools.com

pmblair
10-19-2007, 12:42 AM
I used to use w3schools.com all the time... GREAT stuff!