PHP Support
PHP (Hypertext Preprocessor)
PHP is a server-side embedded scripting language derived originally from a group of Perl scripts written by Rasmus Lerdorf back in 1994. Since then PHP has evolved into a robust and powerful embedment for HTML documents and in most cases is easier to implement than it's progenitor, Perl. For more in depth information on PHP, click the icon to the right. |
|
|
Some "Words of Caution" and "Words to Live By"
PHP is a powerful but very literal language and is intolerant of incorrect syntax. Unlike plain HTML which simply ignores erroneous commands, PHP will blank out, (never preprocess at runtime) or error out if you have as little as an accent grave out of place
If you dont know what an accent-grave is remember this, every symbol on your keyboard has a name, (get to know them) and in PHP almost all of them are some form or sub form of a PHP command including the invisible ones like control characters.
The way you edit and download/upload a PHP scripts is very important and needs to be done in a way so you do not strip or add any of those pesky invisible characters like ^Ms (control-M) ,(carriage return). Having one of these invisible goodies at the end of each line in your script is a reason to not pre-process as far as PHP is concerned, while plain HTML and some other languages could care less and would continue unabated.
To avoid this embarrassment, force your FTP client to ASCII mode before doing a download or upload and always save your edits as a plain text files only.
PHP scripts can reside anywhere in your directory structure, unlike Perl script which must reside in the "cgi-bin" directory located in your websites root directory,
PHP script files must use the .php extension for their filenames.
PHP scripts must "\" (escape) all "@" (at signs) in any text portions such as in the text of an email address. The "@" is a reserved character used to signify arrays in PHP.
The Rudimentary PHP Webpage.
PHP scripts do not generate HTML as is true with Perl Webpages, they instead are HTML pages with PHP tags embedded within them (a subtle but fundamental difference). The following code is a simple PHP script that is an HTML webpage with a PHP component. The basic embeddment principles and techniques apply to most PHP scripts in one way or another.
<HTML><HEAD><TITLE>Simple PHP Webpage</TITLE></HEAD>
<BODY> <?php echo ("This is a simple PHP webpage."); ?>
</BODY>
</HTML>
The third line is the PHP embeddment.
This line simply uses the PHP pre-processor to print "This is a simple PHP webpage.". When you view the source with a browser, you will only see this sentence and none of the PHP tag and syntax will appear. That's how a pre-processor works, just like Server Side Includes.
All the other lines are plain old HTML.
You can substitiute PHP variables for words or literally anything in the HTML document and instantly you have create a dynamic webpage. This is the fundamental distillation and essence of dynamic webpages, of course most are a bit more complex than this example.
PHP Compatibility
PHP is the recommended dynamic webpage language here at TheMACisp. It is supported by both Macromedia Dreamweaver and Adobe GoLive which are by no small coincidence, Some of TheMACisp's recommended WebSite building software.
PHP has a whole family of functions for interfacing with a mySQL database which is the databases system available to hosting users here at TheMACisp. A good reference for using mySQL with PHP is Web Database Applications with PHP & MySQL.
TheMACisp provides all hosting users the PHP3 and PHP4 language versions.
Currently we have PHP configured with the following modules for your use: Check List. Other modules you need may be installed depending on systems security and reliability, Check by calling tech support at: 1-800-337-0663.
|
|
|