PHP Tutorials

Whether just getting started or an expert, this vast collection of PHP tutorials will help you create dynamic content for powerful web-based applications in no time.

Results via Envato Market

By Ying Zhang on July 30, 2000 This document describes how to customize the session handlers in PHP4. We will provide examples of how to write a fully functional session handler that works with DBM files and one that works with a MySQL database. New to PHP4 was a set…

By Ying Zhang on July 30, 2000 Session Handler Functions Any custom session handler we write will have to provide 6 basic functions, they get called by the PHP4 session handler so you do not need to worry about calling them yourself. The nice thing about all this is that…

By Ying Zhang on July 30, 2000 A DBM Session Handler Our first example is to write a customized session handler to save session data into a DBM file. (This is the session_dbm.php file from ying20000602.zip.) There are many reasons why you might want to do this, for example, if…

By Ying Zhang on July 30, 2000 Our 6 functions will now work against a MySQL database: sess_open($sess_path, $session_name); We need to connect to the MySQL database here using mysql_pconnect(), and then selecting the session database using mysql_select_db(). The $sess_path and $session_name parameters are irrelevant but we have to keep…

By Ying Zhang on July 30, 2000 A MySQL Session Handler Our next example is to write a customized session handler to save session data into a MySQL database. (This is the session_mysql.php file from ying20000602.zip.) You would want sessions stored in a database when you have lots of web/PHP…

By Ying Zhang on July 30, 2000 Formatting with Custom Markup Tags You can provide your own special markup tags for the user to use. For example, you can allow the to use [b]…[/b] for bolding, and [i]…[/i] for italics. Those would be simple string replace operations: $output = str_replace(“[b]”,…

By Ying Zhang on July 30, 2000 Some notes: Remember to do string replacements after you call htmlspecialchars() and not before, otherwise all your hard work in turning your custom markups into HTML markups will be lost when you call htmlspecialchars(). Remember to search for the HTML entity and in…