
PHP Hypertext Preprocessor Version 3 is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.
PHP 3 (Release 1.0 available June 1, 1998) has been installed on triton in your instructor's cgi-bin directory. This new language is very powerful and promises to be a very valuable tool.
Perhaps the strongest and most significant feature in PHP3 is its database integration layer. Writing a database-enabled web page is incredibly simple. The following databases are currently supported:
Oracle PostgreSQL
Sybase Adabas D
mSQL 1.x and 2.x FilePro
MySQL dBase
Solid Unix dbm
Generic ODBC
Note: Not all of these databases will be supported on triton. Only
MySQL, and Unix dbm are supported at this time.
The Oracle support is waiting until CANS installs the new ORACLE with the
C-language API. This will probably not happen in
time for this semester's course
Because the scripts are run under your userid, they can do considerable damage if installed and used improperly. You should be familiar with the Security Implications of PHP before you begin using it.
The PHP executable is a binary file of over 1.6 MB in size. You will need to have it in your cgi-bin directory to run it. To avoid copying it and using your quota to store it, a symbolic link to the one physical copy in your instructor's directory will be used instead.
It is very important that you also place a PHP initialization file named php3.ini into your cgi-bin directory along with your php executable. This file configures the PHP program and the most important line in this file is as follows:
Note: in the commands which follow, user types the part in bold.
% cd ~/WWW/cgi-bin % cp ~schmitt/WWW/cgi-bin/php php
% cp ~schmitt/WWW/cgi-bin/php3.ini .
% jove php3.ini
Note: To write and save your changes in jove use: ^X^W
To exit jove use: ^X^C
% cd % mkdir cgi-php
% chmod 700 cgi-php
% cd cgi-php
% cp ~schmitt/cgi-php/99bottles.php3 .
"Mastering Regular Expressions" by Jeffrey Friedl (an O'Reilly Nutshell book) is good. More than you ever wanted to know about regexes. Also has the definitive regex for verifying email address. (Which is a full page in tiny print.)
Date: 06-17-98 13:27Joe, who says: I'm not willing to give out the code, but if you need any help with anything at all, just ask!I have a board that I've written from scratch in PHP up at http://www.vqf.com/bbs/ (it's taken a while. I probably started working on it around Christmas, this is second or third generation ;-). Maybe one of these days if I get the code into some manageable state, I'll release it. I might go ahead and use the "tabled" index listing, it does seem cleaner than the WWWBoard-ish look that I have mine using right now. Of course, that's one of the cool things about PHP - I can change any of the formatting and not have to update every damned page. ;-)
Check out my board, let me know what you think. If enough people are interested, maybe I'll clean it up and let it loose..... I'm open for suggestions. Features that it supports right now:
- * Threaded posting
- * Searching (currently down on my example one, gimme a week or two to get it back up).
- * Optional usernames. Registered names cannot be used by other visitors.
- * Email if reply. If you post a message, you can choose to be notified via email about it.
- * 24 hour digest. You can choose to signup and have a digest of the messages sent to you daily (processed via a cron job).
- * Preference storing in conjunction with the username. Stores username, password, email address, optional ICQ number, email if reply setting (on or off), digest setting, and other crap I'm probably missing.
- * IP address banning, complete with varying ban levels (0 = no ban, 1 = can not post but still allowed access, 2 = no entry at all).
- * User levels. Super admins can determine whether or not to allow standard admins access to specific admin features (look below).
- * Admin features: delete posts, edit all fields of a post, topic locking (no more replies may be posted to a specific message or complete thread).
- * Spam address harvesting prevention. I have been on boards where addresses have been harvested using a bot that detects all mailto: links and then adds the addresses to a spam database. So my forum uses a nifty little form that automatically sends the mail, never actually displaying the user's address... Nice for privacy, too.
I'm sure there's other things I've left off..... Like I said - let me know what ya think!
Date: Fri, 1 May 1998 12:57:30 +0300 (EET DST) From: Vladimir LitovkaJust solved problem with caching pages, generated with PHP. If you want not to cache such documents, you can use following combination of headers: Header("Cache-control: no-cache"); Header("Expires: ".GMDate("D, d M Y H:i:s")." GMT"); ?> The first header - for HTTP/1.1 compatible proxies/clients, the second - for the rest.
I am working on one as we speak at personals.net-virtual.com.... You are welcome to check it out.. It has some "wierd" features such as changing the colours depending on what sex the person is, etc... It's more of an experiment.... Ignore the things about it "costing money", cuz it's still free.... I don't know what (if anything) I'll be doing with it but it might help give you some ideas....
Greg Saylor <webmaster@net-virtual.com>