PHP
Send Link to a Friend for PHP - Part 2
by Tom Muck - 18-Nov-09
Reader Level:
This article will show how to create a simple "send link to a friend" form for a PHP web site, which is a frequently requested topic. Part 1 created the basic form and email functionality using the CMXMail email class shown in this article. The mail class is also included in the support files download for this article, but you can reference the previous article to understand the functionality better. Part 2 adds some validation to the fields using Spry, built into Dreamweaver.
The Send Link to a Friend for PHP Series:
Send Link to a Friend for PHP
Send LInk to a Friend for PHP - Part 2
Apache Fancy Indexing Directory Listing with PHP
by Steven Seiller - 13-Nov-09
Reader Level:
This script lists the contents of files and directories in the Apache Web Server. While Apache has built-in functionality to list files and directories with the FancyIndexing directive, the functionality is limited and the icons are outdated.
This script lists the contents of any directory or sub-directory into which the script is placed for the purpose of browsing, viewing or saving files. It features contextual icons for file types and only list files and directories found within the structure of the script's directory. You can even add your own style sheet to the listings.
It is possible to directly alter the Apache configuration to display listings with your preferred style, but you need root access to the underlying levels of the Web server and advanced knowledge of the configuration. If you have root access, you can also simply change the default icons provided with Apache which is limited in terms of file types. Since many developers do not have root access to their Web server nor wish to muck about in the configuration, this script provides an easy alternative to customizing directory listings.
This tutorial will demonstrate how to use this directory listing script and show you the one line of code which (possibly) needs to be customized for your Web server. You will also be shown how you can customize the script to incorporate your site design, data display and how to implement the configuration on a site-wide basis. Advanced and developing PHP programmers can also explore the functionality of:
- reading directories of files
- reading file attributes including date, extension, and size
- sorting arrays
- formatting the file size to human readable display
- working with server path and links
Send Link to a Friend for PHP
by Tom Muck - 04-Nov-09
Reader Level:
This article will show how to create a simple "send link to a friend" form for a PHP web site, which is a frequently requested topic. Part 1 will create the basic form and email functionality using the CMXMail email class shown in this article. The mail class is also included in the support files download for this article, but you can reference the previous article to understand the functionality better. Part 2 will add some validation to the fields using Spry.
PHPMailer-ML - Mailing List Manager and eMessage Manager
by Steven Seiller - 28-Oct-09
Reader Level:
PHPMailer-ML is a mailing list and newsletter management tool. It leverages the easy-to-use and powerful PHPMailer package from an online administrative center that you run on your own web server. You can use PHPMailer-ML to receive subscription requests from your website and to manage your mailing list. From PHPMailer-ML you can send emails to your mailing lists in HTML or plain text format. The administrative center allows you to create mailing campaigns, select mailing lists and create e-mails. Like PHPMailer, PHPMailer-ML is distributed for free under the General Public License (GPL). This tutorial will show you how to install and use the basic features of PHPMailer-ML.
PHPMailer-ML was originally developed to showcase the function of PHPMailer in 2008. During 2009 the project has received significant development in terms of interface, CSV import function and newsletter editing. PHPMailer is a popular, top-rated PHP class for simplifying the sending of plain text e-mail, HTML e-mail and attachments.
PHP Is Losing Its Magic-Get Used to It Now
by Steven Seiller - 14-Oct-09
Reader Level:
The use of Magic Quotes in your PHP scripts has long been shown to be an insecure method of security. While this function is currently in the process of being deprecated, it will finally be removed as a PHP 6. Make your transition process easier by taking the time now to assess your reliance on the Magic Quotes directive and revise your scripts if needed.
Cartweaver Admin Hints and Mods - Part 9: Creating a Taxes Collected Report Using PHP
by Tom Muck - 06-Oct-09
Reader Level:
Cartweaver is an online shopping cart system available from www.cartweaver.com for PHP, ColdFusion, and ASP. It is intended as an easy-to-use solution for building an online store. It doesn't have all the bells and whistles of some of the more pricey carts available, but with a little coding, many new features can be added.
This is Part 9 in the series and will show how to set up a tax collected report in PHP, using the existing orders report as a starting point.
The Cartweaver Admin Hints and Mods Series:
Cartweaver Admin Hints and Mods - Part 1: Creating a Low Stock Warning for PHP
Cartweaver Admin Hints and Mods - Part 2: Creating a Low Stock Warning for ColdFusion
Cartweaver Admin Hints and Mods - Part 3: Creating an Order Report Graph for ColdFusion
Cartweaver Admin Hints and Mods - Part 4: Creating an Order Report Graph for PHP
Cartweaver Admin Hints and Mods - Part 5: Adding Customer Search Parameters for ColdFusion
Cartweaver Admin Hints and Mods - Part 6 Adding Customer Search Parameters for PHP
Cartweaver Admin Hints and Mods - Part 7: Creating and Order Report for Products Using PHP
Cartweaver Admin Hints and Mods - Part 8: Creating an Order Report for Products Using ColdFusion
Cartweaver Admin Hints and Mods - Part 9: Creating a Taxes Collected Report Using PHP
Cartweaver Admin Hints and Mods - Part 10: Creating a Taxes Collected Report Using ColdFusion
PHP Sledgehammer: array_map
by Steven Seiller - 14-Sep-09
Reader Level:
In PHP you have an array of data that you wish to transform with a function. You might be tempted to create a control structure and loop through each value of the array, applying the function as you go. PHP has an easier method for accomplishing this process. It is the sledgehammer known as array_map. I find this function useful, for example, to trim the whitespace from incoming form data.
Cartweaver Admin Hints and Mods - Part 7: Creating an Order Report for Products Using PHP
by Tom Muck - 09-Sep-09
Reader Level:
Cartweaver is an online shopping cart system available from www.cartweaver.com for PHP, ColdFusion, and ASP. It is intended as an easy-to-use solution for building an online store. It doesn't have all the bells and whistles of some of the more pricey carts available, but with a little coding, many new features can be added. This is Part 7 in the series and will show how to set up a product sales report, using the existing orders report as a starting point.
The Cartweaver Admin Hints and Mods Series:
Cartweaver Admin Hints and Mods - Part 1: Creating a Low Stock Warning for PHP
Cartweaver Admin Hints and Mods - Part 2: Creating a Low Stock Warning for ColdFusion
Cartweaver Admin Hints and Mods - Part 3: Creating an Order Report Graph for ColdFusion
Cartweaver Admin Hints and Mods - Part 4: Creating an Order Report Graph for PHP
Cartweaver Admin Hints and Mods - Part 5: Adding Customer Search Parameters for ColdFusion
Cartweaver Admin Hints and Mods - Part 6 Adding Customer Search Parameters for PHP
Cartweaver Admin Hints and Mods - Part 7: Creating and Order Report for Products Using PHP
Cartweaver Admin Hints and Mods - Part 8: Creating an Order Report for Products Using ColdFusion
Cartweaver Admin Hints and Mods - Part 9: Creating a Taxes Collected Report Using PHP
Cartweaver Admin Hints and Mods - Part 10: Creating a Taxes Collected Report Using ColdFusion
PHP Undo Delete Button in Dreamweaver
by Paul Davis - 03-Sep-09
Reader Level:
For those of us with Gmail accounts, we have seen, after deleting an email, the undo link show up on the page. Sometimes that is a real savior for me! Of course, it is also nice that I don't have to confirm each delete that I do. I looked in to a simple way to have an undo button on my delete functionality for database tables. With a few quick steps, we can make this work for you as well.
Creating a Form Confirmation Page in PHP
by Tom Muck - 27-Aug-09
Reader Level:
A confirmation page is the last page you reach before submitting a form -- you fill in the fields, click submit, review your information, and then submit one final time. Confirmation pages can be built in different ways. I'll show one method, using PHP, that utilizes hidden form fields to post to your final action page. I'll leave the bells and whistles to the reader (validation, CSS, etc.) and show the meat of the technique that is being used.
File Uploads with PHP - Part 4: Storing File Information in a Database
by Steven Seiller - 31-Jul-09
Reader Level:
So far in this series, we have treated the uploaded file by saving it directly to the filesystem of the web server. So, now what? In most applications where files are uploaded to the server, typically some of the file information is stored in a database.
In this fourth part of the series, we will go deeper into the process of storing file information in a database. This part demonstrates the process of creating a BLOB data field in MySQL and storing uploaded files in it. Also demonstrated is the process of retrieving files from the database and downloading them through the browser.
The File Uploads with PHP Series:
File Uploads with PHP - Part 1: Form and File Handling
File Uploads with PHP - Part 2: Multiple Files
File Uploads with PHP - Part 3: Type or Size Restrictions
File Uploads with PHP - Part 4: Storing File Information in a Database
Cartweaver Admin Hints and Mods - Part 6: Adding Customer Search Parameters for PHP
by Tom Muck - 30-Jul-09
Reader Level:
Cartweaver is an online shopping cart system available from www.cartweaver.com for PHP, ColdFusion, and ASP. It is intended as an easy-to-use solution for building an online store. With a little coding, many new features can be added. This is the sixth part in the series and will show how to modify the Customer search form in the admin for additional search fields for PHP.
The Cartweaver Admin Hints and Mods Series:
Cartweaver Admin Hints and Mods - Part 1: Creating a Low Stock Warning for PHP
Cartweaver Admin Hints and Mods - Part 2: Creating a Low Stock Warning for ColdFusion
Cartweaver Admin Hints and Mods - Part 3: Creating an Order Report Graph for ColdFusion
Cartweaver Admin Hints and Mods - Part 4: Creating an Order Report Graph for PHP
Cartweaver Admin Hints and Mods - Part 5: Adding Customer Search Parameters for ColdFusion
Cartweaver Admin Hints and Mods - Part 6 Adding Customer Search Parameters for PHP
Cartweaver Admin Hints and Mods - Part 7: Creating and Order Report for Products Using PHP
Cartweaver Admin Hints and Mods - Part 8: Creating an Order Report for Products Using ColdFusion
Cartweaver Admin Hints and Mods - Part 9: Creating a Taxes Collected Report Using PHP
Cartweaver Admin Hints and Mods - Part 10: Creating a Taxes Collected Report Using ColdFusion
File Uploads with PHP - Part 3: Type or Size Restrictions
by Steven Seiller - 23-Jul-09
Reader Level:
To handle file uploads, use built-in PHP functionality. File uploads can be integrated in applications such as form submissions, file sharing, image uploads or FTP replacement. PHP features a superglobal array specifically for uploaded files as well as specific functions for handling uploaded files.
Part Three of this script will demonstrate how to limit file uploads based on the size or type of file. These checks will be done with data supplied by the common gateway interface and built-in PHP functions. Also, we'll discuss important security considerations which need to be addressed when limiting file acceptance. Finally, we'll look at reporting file upload errors.
The File Uploads with PHP Series:
File Uploads with PHP - Part 1: Form and File Handling
File Uploads with PHP - Part 2: Multiple Files
File Uploads with PHP - Part 3: Type or Size Restrictions
Cartweaver Admin Hints and Mods Part 4: Creating an Order Report Graph for PHP
by Tom Muck - 13-Jul-09
Reader Level:
Cartweaver is an online shopping cart system available from www.cartweaver.com for PHP, ColdFusion, and ASP. It is intended as an easy-to-use solution for building an online store. It doesn't have all the bells and whistles of some of the more pricey carts available, but with a little coding, many new features can be added.
Part 3 showed how to create a simple order graphical report to the Cartweaver admin for ColdFusion. This part will show the same functionality for the PHP version of Cartweaver.
Note that ColdFusion has built-in graphing capabilities, whereas PHP requires the use of a third-party library. This article uses the JpGraph library for PHP, described in this article by Steven Seiller: JpGraph: PHP Graphs & Charts On-The-Fly. Steven's article explains the graphing process. This article will focus on building the report query. The library is readily available and easily installed locally. It requires the GD Image library to be installed into your PHP installation, compiled on a Linux host or included in your extensions directory in Windows. See Steven's article for more information.
The Cartweaver Admin Hints and Mods Series:
Cartweaver Admin Hints and Mods - Part 1: Creating a Low Stock Warning for PHP
Cartweaver Admin Hints and Mods - Part 2: Creating a Low Stock Warning for ColdFusion
Cartweaver Admin Hints and Mods - Part 3: Creating an Order Report Graph for ColdFusion
Cartweaver Admin Hints and Mods - Part 4: Creating an Order Report Graph for PHP
Cartweaver Admin Hints and Mods - Part 5: Adding Customer Search Parameters for ColdFusion
Cartweaver Admin Hints and Mods - Part 6 Adding Customer Search Parameters for PHP
Cartweaver Admin Hints and Mods - Part 7: Creating and Order Report for Products Using PHP
Cartweaver Admin Hints and Mods - Part 8: Creating an Order Report for Products Using ColdFusion
Cartweaver Admin Hints and Mods - Part 9: Creating a Taxes Collected Report Using PHP
Cartweaver Admin Hints and Mods - Part 10: Creating a Taxes Collected Report Using ColdFusion
File Uploads with PHP - Part 2: Multiple Files
by Steven Seiller - 09-Jul-09
Reader Level:
In Part 1, we explored a script which provided you the basic functionality of handling an uploaded file by storing it on the server. The form demonstrated the enctype attribute as well as the file input. The script used built-in PHP functions for handling the uploaded file and moving it on the server. For convenience, we also changed the file permissions to ensure user can access it on the server.
In Part 2, we will explore the ability to process multiple file uploads to give you greater control over what users may upload.
The File Uploads with PHP Series:
File Uploads with PHP - Part 1: Form and File Handling
File Uploads with PHP - Part 2: Multiple Files
File Uploads with PHP - Part 3: Type or Size Restrictions
File Uploads with PHP - Part 1: Form and File Handling
by Steven Seiller - 22-Jun-09
Reader Level:
To handle file uploads, use built-in PHP functionality. File uploads can be integrated in applications such as form submissions, file sharing, image uploads or FTP replacement. PHP features a superglobal array specifically for uploaded files as well as specific functions for handling uploaded files.
Part One of this script will demonstrate how to set up an HTML form for file uploading as well as a PHP script example for processing uploaded files. This demonstration script can be used as an FTP replacement, providing a method for laymen to upload files to the server without access to an FTP client.
The File Uploads with PHP Series:
File Uploads with PHP - Part 1: Form and File Handling
File Uploads with PHP - Part 2: Multiple Files
File Uploads with PHP - Part 3: Type or Size Restrictions
JpGraph: PHP Graphs & Charts On-The-Fly
by Steven Seiller - 09-Jun-09
Reader Level:
JpGraph is an object-oriented PHP library for creating graphs on the fly with your selected data for display on web pages. The library features a wide range of graph types with which you can draw with your own data. You can supply data from a database, a text file, a form or even with a GET query string.
Generating web-based graphs for display on web pages can be useful for business intelligence or marketing collateral. The advantage of creating a graph dynamically from data is that the visitor always sees an up-to-date chart which reflects current data.
This tutorial will briefly give you an overview of the installation procedure and how to create several graphs, including the source code. The JpGraph library is easy to use, features a wide range of customization options as well as many graph types.
Cartweaver Admin Hints and Mods Part 1: Creating a Low Stock Warning for PHP
by Tom Muck - 03-Jun-09
Reader Level:
Cartweaver is an online shopping cart system available from www.cartweaver.com for PHP, ColdFusion, and ASP. It is intended as an easy-to-use solution for building an online store. It doesn't have all the bells and whistles of some of the more pricey carts available, but with a little coding, many new features can be added.
In Part 1 of this series, we will show how to add a low-stock warning to the Cartweaver admin.
The Cartweaver Admin Hints and Mods Series:
Cartweaver Admin Hints and Mods - Part 1: Creating a Low Stock Warning for PHP
Cartweaver Admin Hints and Mods - Part 2: Creating a Low Stock Warning for ColdFusion
Cartweaver Admin Hints and Mods - Part 3: Creating an Order Report Graph for ColdFusion
Cartweaver Admin Hints and Mods - Part 4: Creating an Order Report Graph for PHP
Cartweaver Admin Hints and Mods - Part 5: Adding Customer Search Parameters for ColdFusion
Cartweaver Admin Hints and Mods - Part 6 Adding Customer Search Parameters for PHP
Cartweaver Admin Hints and Mods - Part 7: Creating and Order Report for Products Using PHP
Cartweaver Admin Hints and Mods - Part 8: Creating an Order Report for Products Using ColdFusion
Cartweaver Admin Hints and Mods - Part 9: Creating a Taxes Collected Report Using PHP
Cartweaver Admin Hints and Mods - Part 10: Creating a Taxes Collected Report Using ColdFusion
Sending Email from PHP in Windows
by Rob Williams - 04-May-09
Reader Level:
One of the most commonly used features of PHP is the mail function (or some class built around it). This handy command allows you to send emails from within your PHP code, providing a wide variety of handy features ranging from client notifications to administrative reminders. However, if you're working on a Windows-based testing server you'll often find that that mail functionality simply doesn't work!
In this article we're going to look at why this is and two easy ways to help remedy the problem.
PHP Output Buffer: The Programmer's Assistant
by Steven Seiller - 27-Apr-09
Reader Level:
PHP's Output Buffering has many useful applications and should be in the toolbox of any advanced PHP coder. In short, PHP can save the output of content to the browser in a temporary buffer until called to use it. Buffering output has many applications inlcuding:
- Sending headers such as a cookie after beginning to process a page.
- Output at once the contents of a dynamically-built page.
- Capturing page content until the script determines where the content will be used.
- Capture and re-routing script errors instead of displaying to visitor.
- Redirecting page output to a log file or email body.
- Conducting string replacement on page content to provide custom mark-up or vocabulary.
- Dynamically building images with PHP.
- Compressing page output to provide a faster download to the visitor.
- Using show/hide logic for verbose content.
Learning PHP - Part 6: Class Extensions and Templates
by Rob Williams - 20-Apr-09
Reader Level:
This article aims to carry on where Thomas Pletcher's previous articles left off in introducing some of the more advanced features of PHP 5's object-oriented programming (OOP) model.
Today's focus will be on how to extend classes, through inheritance, abstractions and interfaces.
The Learning PHP Series:
Learning PHP - Part 1: A Gentle Introduction
Learning PHP - Part 2: All About Arrays
Learning PHP - Part 3: Basic Content Management
Learning PHP - Part 4: Focus on Functions
Learning PHP - Part 5: An Introduction to Object-Oriented Programming
Learning PHP - Part 6: Class Extensions and Templates
Select Random Content with PHP and MySQL
by Steven Seiller - 08-Apr-09
Reader Level:
You want to provide random content from your database to visitors of your web page. This might include random news, products, events or testimonials. How do you select random content from your MySQL database? During the visitor's time on your web page, you wish to not repeat the display of the same content. How do you not repeat the same random content?
In this tutorial, we will use PHP and MySQL to randomly pick and display content to the visitor. For extra credit, we will track the content the user has already been shown and not repeat it. We will also look at a way to further customize the chosen content.
Creating an Alphabetical Directory Listing with PHP and MySQL
by Steven Seiller - 31-Mar-09
Reader Level:
You want to create an alphabetic listing of database records by grouping them by their first letter. As a convenience, you want to provide a menu of alphabet letters with hyperlinks to take you directly to the records for that letter. How do you create an alphabetic listing of database records without performing 26 queries - one for each letter?
I've reduced the process to just one query which first selects the first letter represented by the records and then grabs the data itself. I created arrays for each letter to store data until it is displayed. The script uses a few advanced PHP bits to keep the code concise including:
- MySQL substring() function
- range() function
- array_key_exists() function
- ternary operator
- variable variables
Easy Dates With PHP DateTime Class
by Steven Seiller - 17-Mar-09
Reader Level:
PHP version 5.2.0 expanded its date handling capabilities with a new class and procedural methods. With pre-defined formats, outputting dates requires less arcane formatting knowledge. The new DateTime Class adds to PHP's object-oriented collection of functionality, although not fully implemented. This article will introduce you to these new features which should give you more direct approaches to formatting and outputting dates and times. The attached demonstration file shows all of the formats in action.
Heredoc and Nowdoc: PHP Strings of Convenience
by Steven Seiller - 02-Mar-09
Reader Level:
In PHP, strings are created in one of two fashions: exactly as stated or by including the value of variables which have been placed in the string. PHP offers to syntax methods for creating longer strings: heredoc and nowdoc. This article will demonstrate the syntax for these methods and provides some examples for their use.
Making Your Own FAQ - Part 1
by Paul Davis - 26-Feb-09
Reader Level:
Need to create a quick FAQ (frequently asked question) for a web site? With Dreamweaver, a little JavaScript and SQL, we can have a nice display in place in less than an hour!
The Make Your Own FAQ Series:
Making Your Own FAQ - Part 1
Making Your Own FAQ - Part 2: Adding Categories and Search
Making Your Own FAQ - Part 3 Coming Soon
Making Your Own FAQ - Part 4 Coming Soon
Conditional PHP: Using the Ternary Operator
by Tom Muck - 09-Feb-09
Reader Level:
There are many uses for conditional statements in programming. The basic principle of conditional programming is that you want to execute code based on a certain condition. The essence of conditional programming is executing code based on the condition being true, with an alternate piece of code being executed if the condition is not true. The article will explain the ternary operator, which creates if/else logic that is more concise than other methods.
Creating a Formatted Unique ID in PHP
by Tom Muck - 19-Nov-08
Reader Level:
There are often times that you need a unique id in an application, but don't want to use an auto-incrementing integer. If an application is well designed and secure, an auto-incrementing number is usually fine, but to be on the safe side a unique identifier other than an integer is better as an id. For example, a customer number is a good use of a unique identifier, or an order number.
Build Your Own Contact Forms - Part 4: Spam Prevention
by Steven Seiller - 13-Nov-08
Reader Level:
Preventing form spam can be a fairly simple process with thoughtful programming and error trapping. Most developers use CAPTCHA, those little images with distorted letters which you have to decipher and enter. Other tests might include simple math problems and questions with obvious answers. Personally, I detest those vision tests and feel it is a certain way to turn away potential customers. They are getting so distorted these days, they are almost impossible to decipher. Recently, It took me three attempts to get through one of those!
Here are some effective spam blocking techniques which don't involve vision tests.
The Build Your Own Contact Form Series:
Build Your Own Contact Forms - Part 1: Workflow
Build Your Own Contact Forms - Part 2: The HTML Form
Build Your Own Contact Forms - Part 3: The PHP Processing Script
Build Your Own Contact Forms - Part 4: Spam Prevention
Build Your Own Contact Forms - Part 3: The PHP Processing Script
by Steven Seiller - 12-Nov-08
Reader Level:
In Part 1, we discussed the purpose of utilizing contact forms and their general workflow. In Part 2, we created the HTML form which is used by the site visitor to enter specific, required information with their request. In this part, we will use PHP to construct a server-side processing script to handle the incoming data, validate it and send email to the submitter.
We'll be using a PHP class to ensure that specific fields have been submitted and to ensure that any email address submitted has valid syntax. To send the email, the PHPMailer class will be employed to make process quick and easy. This class increases form security over the easily exploitable PHP mail function. In our sample script, we'll email the submitted data to a specified recipient and send an email confirmation to the submitter from the specified recipient.
The Build Your Own Contact Form Series:
Build Your Own Contact Forms - Part 1: Workflow
Build Your Own Contact Forms - Part 2: The HTML Form
Build Your Own Contact Forms - Part 3: The PHP Processing Script
Build Your Own Contact Forms - Part 4: Spam Prevention
Blank Pages in PHP
by Tom Muck - 06-Nov-08
Reader Level:
If you are a PHP developer, you are likely familiar with the blank page -- an error page with no error message. PHP has some default settings that prevent any error messages from appearing when you install PHP and do not adjust the error display settings. This article will show how to show your error messages.
Build Your Own Contact Forms - Part 2: The HTML Form
by Steven Seiller - 29-Oct-08
Reader Level:
No contact form can be successful without a functional form. Your HTML form needs to be coordinated with the purpose of the contact, your data requirements and needed information. Clearly provide directions for completion of form fields and mark required information. Provide examples of how specific information needs to be formatted, if required. Avoid passing sensitive information via hidden form fields. Create customized forms on the fly with server-side scripting. Add a bit of style to enhance usability.
The Build Your Own Contact Form Series:
Build Your Own Contact Forms - Part 1: Workflow
Build Your Own Contact Forms - Part 2: The HTML Form
Build Your Own Contact Forms - Part 3: The PHP Processing Script
Build Your Own Contact Forms - Part 4: Spam Prevention
Creating MySQL Logins for a Web Site
by Tom Muck - 20-Oct-08
Reader Level:
MySQL is a popular database to use for your web site, allowing the power of a server-based database management system to be used for free. With the added power comes added danger—MySQL is frequently targeted by hackers. My article on preventing SQL injection attacks mentioned database login security briefly.
In this article, I will expand on how to actually create users for your web site, which is vital knowledge when you are acting as a database administrator. If you have a PHP site using MySQL and you don't have a database administrator—you are it.
Build Your Own Contact Forms - Part 1: Workflow
by Steven Seiller - 14-Oct-08
Reader Level:
This tutorial will describe the functions of web site contact forms and how to create its processing script. We'll cover the creation of the HTML form and use PHP to create the processing script which handles the submitted data and sends the email. Along the way, we'll review best practices in data validation, storage, spam prevention and security.
At the end of this series, you should understand all the aspects of the contact form workflow and be able to create your own PHP processing script. By knowing the process, you will be able to build your own PHP contact form customized to your specific needs. Should you decide to implement a commercial or open-source contact form, you will be able to readily manage the process.
The Build Your Own Contact Form Series:
Build Your Own Contact Forms - Part 1: Workflow
Build Your Own Contact Forms - Part 2: The HTML Form
Build Your Own Contact Forms - Part 3: The PHP Processing Script
Build Your Own Contact Forms - Part 4: Spam Prevention
Processing Submitted HTML Form Data - Part 2: PHP
by Steven Seiller - 19-Aug-08
Reader Level:
This tutorial will walk through the essentials of processing submitted HTML form data. Whether you are processing information submitted through a contact form, a blog or a content management system, you must understand the essential components of submitted form data in order to process the submitted information. You might process the submitted data with ASP, ColdFusion, PHP or Perl but regardless of the scripting language you choose, the data submitted through the Common Gateway Interface (CGI) remains the same.
In Part 1 of this tutorial, we reviewed the CGI process and the two methods of submitting form data via HTML. Additionally, we will look at the range of form controls at your disposal and the nature of the data returned by each control. In Part 2 of this tutorial, I will use PHP to demonstrate the structure and values of typical form data with sample processing routines.
The Processing Submitted HTML Form Data Series:
Processing Submitted HTML Form Data - Part 1
Processing Submitted HTML Form Data - Part 2: PHP
Add, Edit and Delete Records with PHP and Dreamweaver - Video
by Paul Davis - 29-Jul-08
Reader Level:
Dreamweaver comes with some really great wizards which make the add/edit/delete process for database tables quick work. This tutorial will walk you through creating all of the needed functionality to get this done.
Approximate download size: 17MB
Dynamically Streaming a File in PHP
by Tom Muck - 11-Jul-08
Reader Level:
There are many ways to create a file download from a web site, however, sometimes it is necessary to hide the physical path of the file. In PHP it is possible to dynamically stream the file to the end user, eliminating the chance that a user can download the file directly. This is often a requirement of an e-store that sells downloadable content, such as PDFs of books, music downloads, or software. This article will show one simple way to accomplish this.
PHPMailer: Full Featured Email Transfer Class for PHP - Part 2
by Steven Seiller - 10-Jul-08
Reader Level:
PHP contains a mail function which sends script-generated email with very little configuration and ease. This built-in function, while easily accessible, provides only basic options for creating emails and requires a more manual effort to create advanced email features such html formatting and attachment encoding.
For many years, I have used PHPMailer which is an object-oriented PHP class that easily allows you to implement advanced email formatting. Features which can be readily tapped include: SMTP authentication, use of redundant SMTP servers, attachments, HTML formatting, multipart/alternative formatting for non-html email and various encoding methods. Due to its ease of use and broad feature base, I incorporate the PHPMailer class into all my scripts which send email.
My primary reason for using this class comes from the ability to send script-generated email through authenticated SMTP servers which dramatically reduce the risk of the email being trapped in spam filters. In my testing, mail sent directly from the server by the mail() is significantly more likely to be caught by ISP spam filters due to the fact that it resembles robotically generated spam. I also enjoy the relative ease of adding attachments, html formatting and using multipart/alternative text for email client preview.
In Part 1, I demonstrated how to install the PHPMailer class and use it to create simple email, while sending through an authenticated SMTP server. Use of this class requires some knowledge of working with server files and directories and some experience with PHP classes.
Here in Part 2, we will take it further and go over adding attachments and creating HTML emails.
The PHPMailer - Full Featured Email Transfer Class for PHP Series:
PHPMailer: Full Featured Email Transfer Class for PHP - Part 1
PHPMailer: Full Featured Email Transfer Class for PHP - Part 2
PHPMailer: Full Featured Email Transfer Class for PHP - Part 1
by Steven Seiller - 25-Jun-08
Reader Level:
PHP contains a mail function which sends script-generated email with very little configuration and ease. This built-in function, while easily accessible, provides only basic options for creating emails and requires a more manual effort to create advanced email features such html formatting and attachment encoding.
For many years, I have used PHPMailer which is an object-oriented PHP class that easily allows you to implement advanced email formatting. Features which can be readily tapped include: SMTP authentication, use of redundant SMTP servers, attachments, HTML formatting, multipart/alternative formatting for non-html email and various encoding methods. Due to its ease of use and broad feature base, I incorporate the PHPMailer class into all my scripts which send email.
My primary reason for using this class comes from the ability to send script-generated email through authenticated SMTP servers which dramatically reduce the risk of the email being trapped in spam filters. In my testing, mail sent directly from the server by the mail() is significantly more likely to be caught by ISP spam filters due to the fact that it resembles robotically generated spam. I also enjoy the relative ease of adding attachments, html formatting and using multipart/alternative text for email client preview.
In this tutorial, I will demonstrate how to install the PHPMailer class and use it to create simple email, while sending through an authenticated SMTP server. Use of this class requires some knowledge of working with server files and directories and some experience with PHP classes.
In Part 2, we will take it further and go over adding attachments and creating HTML emails.
The PHPMailer - Full Featured Email Transfer Class for PHP Series:
PHPMailer: Full Featured Email Transfer Class for PHP - Part 1
PHPMailer: Full Featured Email Transfer Class for PHP - Part 2
Creating CSV Files from Recordsets in PHP - Part 2
by Tom Muck - 16-May-08
Reader Level:
Downloading comma-separated value (CSV) results is a common task in web development. If you have an e-store, for example, you may want to download orders, products, or customers. There are hundreds of other uses—search results, school lists, movie titles, book lists, tables of contents, access reports, web stats, etc.
Part 1 of this series showed a basic CSVFile class with the ability to create a CSV file download from any recordset. This part will show how to make a few tweaks in the class to allow Excel file downloads. The class is already built—all you do is call it. The class does not create a file on the server—it simply streams the content to the user as a file, not cluttering up your server or creating files that then have to be deleted. The article builds on the files used in the last part and simply makes a few changes to them.
The CSV Files in PHP Series:
Downloading PHP Recordsets as CSV Files - Part 1
Creating CSV Files from Recordsets in PHP - Part 2
Downloading PHP Recordsets as CSV Files - Part 1
by Tom Muck - 06-May-08
Reader Level:
Downloading comma-separated value (CSV) results is a common task in web development. If you have an e-store, for example, you may want to download orders, products, or customers. There are hundreds of other uses—search results, school lists, movie titles, book lists, tables of contents, access reports, web stats, etc.
PHP 5.1 has a new function called fputcsv to write a line to a file, but this article will show a technique that will work in older versions of PHP, and is generally very easy to use using a PHP class I wrote a while back. The class is already built—all you do is call it. The class does not create a file on the server—it simply streams the content to the user as a file, not cluttering up your server or creating files that have to then be deleted. I've found over the years that dealing with files on a PHP server has created the worst nightmares for beginning PHP developers. Setting and maintaining the correct file and folder permissions are somewhat of a black art.
The CSV Files in PHP Series:
Downloading PHP Recordsets as CSV Files - Part 1
Creating CSV Files from Recordsets in PHP - Part 2
Code Igniter - Controllers
by Paul Davis - 17-Apr-08
Reader Level:
Delve in to controllers and views for Code Igniter, the basics to get the framework up and running for your site! Code Igniter is an open source PHP framework.
Code Igniter Introduction
by Paul Davis - 08-Apr-08
Reader Level:
Code Igniter, a PHP framework that cooks, cleans and does the dishes. Even comes with a kitchen sink! Code Igniter will spoil you with flexibility, usability and functionality—and then you'll see the manual and never again be satisfied with other product's "documentation"...
From Create a Site to Connecting to a Database
by Paul Davis - 27-Mar-08
Reader Level:
If a picture is worth a thousand words - then a video should be worth millions (if, of course, you account for the 15 frames per second)! In my first video tutorial for Community MX, I am going to show how to set up a new Dreamweaver site using the basic site set up, set up a database on a Linux based server utilizing CPanel and then how to connect to the database.
Approximate download size: 26MB
mySQL Groupies and Subcategories
by Paul Davis - 11-Mar-08
Reader Level:
You need to get all of the categories for each product listed in a report - doing the heavy lifting in PHP seems to take the server extra time to get the work done. Learn about using the GROUP_CONCAT command in mySQL to make quick work of this problem.
Moving A Web Site: Preserving Search Engine Rankings and the Customer Experience
by Steven Seiller - 03-Mar-08
Reader Level:
Have you discontinued a product or renamed your service? Do you need to redirect visitors from an old web site domain to a new web site domain? This tutorial will show you how to use Apache server redirection to automatically transfer incoming traffic from the old site to the new. Additionally, we will use a code to tell the search engines about the permanent change so it will update its index.
What the automatic server redirection will not do, however, is inform the visitor of why they suddenly find themselves at a different website. Using PHP, I will show you a second step which will allow you to display a contextual note to visitors about the change. I devised this extra step to enhance customer service and educate longtime visitors about the changeover. Because this information is displayed only to redirected users, it will not distract new or potential customers.
Copy a Record in PHP Using Dreamweaver
by Paul Davis - 25-Feb-08
Reader Level:
A quick and easy way to copy a record, edit the record contents and insert it as a new record in to your database. By using Dreamweaver server behaviors, this process is a snap!
PHP Phreakout: Troubleshooting Tips for PHP Code
by Steven Seiller - 18-Feb-08
Reader Level:
I call it the "White Screen of Oblivion." You've seen it. You just finished your new code and you eagerly upload it to the server to watch the magic you just conjured. You load the script and wait. And Wait. That white, blank screen opens like a void and sucks your confidence while the concept quickly sinks in that you have a problem. Ok, but what problem? Not even an error message?
With experiences like that, we can actually be happy when we do receive an error message. Even one which says fatal. At least an error message gives us a line number and some kind of a clue!
So what happens when your PHP code doesn't work as expected? What do those messages mean? Sometimes confusing, sometimes cryptic, those little blurbs declaring that you goofed can actually be helpful! In this article, I will describe the process and some tricks I use to troubleshoot my PHP code during initial development.
Case Study: How to Customize a JumpStart
by Steven Seiller - 22-Jan-08
Reader Level:
The primary benefits to the JumpStarts are that they have been tested with the popular browsers and can get you up and running quickly. Having a limited timeframe to get the site redesigned, I decided to give the JumpStarts a good look. What I quickly realized is that despite my disdain for templates, the JumpStarts are highly customizable, which can result in uniques designs.
In this tutorial, I will describe the process I used for assessing my web site needs and selecting a specific JumpStart. We will then walk through the steps of creating a unique design from the example. Finally, I will share an extra step I took in which I used PHP to 'templatize' my page design to speed content creation, ease revisions and provide customized content to the visitor.
Using Quotes in PHP
by Tom Muck - 04-Dec-07
Reader Level:
One of the confusing things for beginning PHP developers is how to use single and double quotes. Unlike some other languages, like ColdFusion, single and double quotes in PHP are treated differently. This article will show how to use quotes in different situations in PHP.
The Secret Art of Cookies: Part 2
by Rob Williams - 15-Nov-07
Reader Level:
Preserving data for an end user can be one of the more challenging tasks when you first start to learn a server-side programming language like PHP. Sessions are a good starting point that allow you to carry information about users across multiple pages of your site, but alone they can fall short of expectations as they are always only limited to the length of a current browsing "session".
In the first part of this series we looked at what cookies were, how easy they were to use, and some of the general pitfalls that developers need to be aware of when utilizing them. Today we're going to focus on setting the record straight on cookie security and the realities of using cookies in your own web applications.
The Secret Art of Cookies Series:
The Secret Art of Cookies: Part 1
The Secret Art of Cookies: Part 2
Creating a Redirected Login
by Rob Williams - 06-Nov-07
Reader Level:
Creating a two-tier web site is a task that most developers have to deal with regularly; often times a site will require both a public and "member's-only" section. Although there are many tutorials and explanations of how to use databases to build and manage login systems, one of the questions that I find often goes unanswered is how to make your login page "transparent".
In this article we'll take a look at the theory and a simple implementation of how you can go about presenting a login page anytime a user is directed to "member's-only" content and, most importantly, how to continue sending them to their desired page once the login is complete.
Controlling the Serial Port with PHP
by Rob Williams - 19-Oct-07
Reader Level:
When you think about the things a web server can do, they typically tend to be related strictly to the virtual world of web sites and electronic content. There are times however when a web server can do what most people would never expect: interact with the real world!
In this article we're going to take a look at an how we can use PHP to control other, non-web related systems, using a serial port.
Autoloading Classes in PHP
by Rob Williams - 08-Oct-07
Reader Level:
When working with object-oriented coding in PHP one of the biggest hassles you'll encounter is having to continually remember to explicitly include/require the appropriate class definition file for each object you want to use. In this article we'll take a look at a new and very handy feature introduced in PHP 5 that will allow you to automatically include class definitions as they're required:__autoload.
A VIEW to Die For!
by Paul Davis - 05-Oct-07
Reader Level:
mySQL v5 introduced the VIEW command to create views in the database, we will go over the how, what and why of VIEWs for mySQL v5.
Is it read yet?
by Paul Davis - 28-Sep-07
Reader Level:
When you browse the Community MX articles, have you noticed the details where it tells you if you've read it before or not? Do you want to do that on your site? Read on...
A Simple Error Handling Function for PHP
by Tom Muck - 24-Sep-07
Reader Level:
Error handling is an important aspect of site development, but using PHP there aren't too many clearly defined ways to handle errors. I will present a simple function that handles errors in several ways: records the error in a log, emails the site administrator a copy of the error, and redirects the user to a central error page. Using one or more of these three methods, you can handle errors more gracefully in your PHP pages.
Creating a Master/Detail Pageset on One Page Using AJAX
by Tom Muck - 19-Sep-07
Reader Level:
Dreamweaver's Master/Detail page set is a handy set of behaviors to use for a drill-down functionality -- display a list of records, and click on a link in the list to view the full record. Using the behaviors, however, you typically create two pages. If you create one page with both, the page will refresh each time you click on a link.
In this tutorial, I'll show how to create one master/detail page that uses some very simple JavaScript to load the details section of the page dynamically using AJAX. This tutorial will apply to PHP, ColdFusion, and ASP, with the concepts applicable to the other available server models that Dreamweaver now supports.
Automatic Code Highlighting in PHP
by Rob Williams - 13-Sep-07
Reader Level:
Sometimes it seems that one of the hardest parts of teaching coding to others is simply getting your source coding to display in a properly formatted and easy-to-understand way. In this article we'll look at one of the built in tools that PHP makes available to you, as a web developer, that is designed specifically to address and solve this problem.
The Secret Art of Cookies: Part 1
by Rob Williams - 10-Sep-07
Reader Level:
Preserving data for an end user can be one of the more challenging tasks when you first start to learn a server-side programming language like PHP. Sessions are a good starting point that allow you to carry information about users across multiple pages of your site, but alone they can fall short of expectations as they are always only limited to the length of a current browsing "session".
What about those times when you want to preserve information (such as a user's login) for a longer period of time? This is where the wonderful world of cookies comes in! In this article we'll explore what cookies are, why they're userful, and how to use them in PHP.
The Secret Art of Cookies Series:
The Secret Art of Cookies: Part 1
The Secret Art of Cookies: Part 2
PHP Sessions - Keeping Data Over Multiple Pages
by Rob Williams - 24-Aug-07
Reader Level:
One of the age old problems with server-side scripting is that it's based on a page-by-page production model; that is, each page is interpreted and run as its own entity as the user requests it. While this makes development more inline with traditional HTML, it also makes it more challenging to create full-fledged applications that may span multiple "pages" of a site.
If you're new to PHP (or indeed most server-side languages) the desire to have variables or data persist across multiple pages has probably arisen several times, but a straightforward explanation of how to do this is often overwhelmingly difficult to find. The purpose of this article is to provide with practical knowledge of both the theories and actual code that you need in order to carry data across multiple PHP pages.
Creating a Simple Database Web Search - Part 2: PHP
by Tom Muck - 13-Aug-07
Reader Level:
In the first part of this series, I showed how to create a Master/Detail page set using built-in Dreamweaver tools, and then add a basic search form querying against one field in the database. What if you want more than that though? The Dreamweaver recordset dialog box allows one filter against one field. This is sometimes useful, but usually not. Typically you might also want to allow other HTML fields into the search. You will want to search allowing multiple search words. Finally, you might want to search multiple database fields.. I will address all three situations in this article, which will be targeted to PHP users only.
The Creating A Simple Database Web Search Series:
Creating a Simple Database Web Search - Part 1
Creating a Simple Database Web Search - Part 2: PHP
Creating a Simple Database Web Search - Part 2: ColdFusion
The World's Easiest PHP/MySQL Testing Server
by Rob Williams - 10-Aug-07
Reader Level:
Setting up a local testing server can be a real pain at times, especially when you want to do more "complex" testing involving PHP, MySQL and Apache. Although there are some good installation packages out there, they can still at times be difficult and frustrating to work with and maintain. In this article we're going to take a look at what has to be the simplest and easiest "local testing server" set up possible: the Uniform Server.
Custom PHP Settings With .htaccess
by Rob Williams - 03-Aug-07
Reader Level:
Every now and again I find as a web developer that there are times when the default PHP configuration on my server just isn't working as well as I'd like it to for a given project. This can be especially plaguing when you're dealing with remote web hosts that offer you little to no control over the configuration of PHP itself. Anytime you're running multiple web sites off the same server this can also be a problem as you may want to have different PHP settings for each of the sites.
In this article we're going to take a look at one possible solution to these problems by including PHP configuration values within an .htaccess file.
The PHP Insert Bar Explained
by Paul Davis - 03-Jul-07
Reader Level:
The PHP Insert bar is a collection of commonly used programming features in PHP. The collection is used to insert a snippet of PHP code in the page and relies upon you to complete the variable information. We will walk through each of the icons on this bar and detail what it does and how to make it complete for your purposes.
Create a Table-less Horizontal Looper in PHP
by Tom Muck - 05-Jun-07
Reader Level:
Dreamweaver has a Repeat Region server behavior that loops through your data and allows you to display it in a vertical or horizontal manner. If you want to display the data in a grid pattern, however, it requires a little more effort. Typically, a Horizontal Looper extension or code is used to create a table and put your individual data sections in a table cell. In this tutorial, I'll show how to do that using <div> tags and CSS without tables.
For this tutorial I'll assume you know how to use MySQL tools to create and manage databases, and how to create connections for PHP in Dreamweaver.
Anti-Spam Measures for PHP and ColdFusion - Part 2
by Tom Muck - 14-Mar-07
Reader Level:
Spam, spam, spam, spam. Spammers have taken over the Internet and made it a horrible place to maintain a web site. Spammers have gone beyond simply spamming your email account -- now they are spamming blogs and guestbooks, spamming trackbacks, and spamming signup forms. Even a child's home page with a guestbook for friends is not safe from links for cialis, porn, or web hosting. Obviously these spammers are getting some return from their criminal activity, because they keep doing it. Unfortunately, you can't reach through the computer screen and grab them by the throat to strangle the life out of them. All you can do is put in place some safeguards and try to minimize the attack. Part 2 in this series shows how you can record the IP address of the spammer and block access to your site to that computer in the future. Once again, I'll assume you have familiarity with PHP or ColdFusion basics (databases, inserting and displaying data) and HTML forms.
The Anti-Spam Measures for PHP and ColdFusion Series:
Anti-Spam Measures for PHP and ColdFusion - Part 1
Anti-Spam Measures for PHP and ColdFusion - Part 2
Anti-Spam Measures for PHP and ColdFusion - Part 1
by Tom Muck - 01-Mar-07
Reader Level:
Spam, spam, spam, spam. Spammers have taken over the Internet and made it a horrible place to maintain a web site. Spammers have gone beyond simply spamming your email account -- now they are spamming blogs and guestbooks, spamming trackbacks, and spamming signup forms. Even a child's home page with a guestbook for friends is not safe from links for cialis, porn, or web hosting. Obviously these spammers are getting some return from their criminal activity, because they keep doing it. Unfortunately, you can't reach through the computer screen and grab them by the throat to strangle the life out of them. All you can do is put in place some safeguards and try to minimize the attack.
The Anti-Spam Measures for PHP and ColdFusion Series:
Anti-Spam Measures for PHP and ColdFusion - Part 1
Anti-Spam Measures for PHP and ColdFusion - Part 2
Smarter Link Lists With PHP
by Gordon Mackay - 27-Feb-07
Reader Level:
On most personal web sites you will find a listing of the the author's favorite sites, but often these links become outdated, or the sites at the end of the links go down for whatever reason. It's very frustrating for users to click on a link, only to be given a 404 page or timeout error, so in this tutorial I will show you how to make a smarter link list that checks to see if the domain being linked to is available or not before printing the link.
Server-Side Includes in PHP - Part 2: Relative Paths
by Rob Williams - 26-Feb-07
Reader Level:
Server-side includes make the development and management of complex web sites easier and more efficient. One common problem that developers often run into though when first learning to use server-side includes is the idea of relative paths. In this article we'll look at why relative paths may not work the way you'd expect them to as well as a fairly simple little "trick" to solve the problem.
The Server-Side Includes in PHP Series:
Server-Side Includes in PHP - Part 1
Server-Side Includes in PHP - Part 2: Relative Paths
Server-Side Includes in PHP - Part 1
by Rob Williams - 08-Feb-07
Reader Level:
Server-side includes are one of the most important concepts for web developers today. They not only save you time but also make sites easier to update and maintain while reducing redundancy and duplicate pieces of code. The cavet that most new developers run into is that although the idea of server-side includes in general seems quite simple, often the implementation can be quite frustrating if not planned out correctly. In this article we'll talk about not only the theory, but also some practical examples, of how to properly implement server-side includes using PHP.
The Server-Side Includes in PHP Series:
Server-Side Includes in PHP - Part 1
Server-Side Includes in PHP - Part 2: Relative Paths Coming Soon
The Lost Art of PHP Control Structures - Part 6: Resource Pointers and One Last Trick
by Rob Williams - 31-Jan-07
Reader Level:
One of the key components of any scripting or programming language are control structures; statements that tell a language interpretter to stop reading code in a linear line-by-line fashion and start to make more complex operations based on simple logic. While most developers are aware of the common "if else" and "for" structures, there are many others available in PHP (and other languages I might add) that allow you to save a great deal of time and make your coding more efficient and easier to understand.
In this series we're going to take a look at some of those "forgotten" structures and some practical examples of how they can be used to clean up your coding techniques. In the final part of this series we'll tie up some loose ends and take a look at one last neat little trick: resource pointers.
The Lost Art of PHP Control Structures Series:
The Lost Art of PHP Control Structures - Part 1: Switch Statements
The Lost Art of PHP Control Structures - Part 2: The Break Command
The Lost Art of PHP Control Structures - Part 3: Advanced Loops and Arrays
The Lost Art of PHP Control Structures - Part 4: Internal Array Pointers
The Lost Art of PHP Control Structures - Part 5: Variables by Reference
The Lost Art of PHP Control Structures - Part 6:Resource Pointers and One Last Trick
Peronalized E-cards with Flash
by Derrick Ypenburg - 29-Jan-07
Reader Level:
I know the busy season for sending out greeting cards to your clients and friends has passed, but you can plan ahead for next year as well as using this tutorial for sending out any customized info and greetings throughout the rest of the year.
Nicely designed e-cards using Flash can send an effective, fully animated-greeting and message to your clients/friends. It also saves you a bundle in printing and mailing costs that come with hard-copy cards and mail-outs. If you're like me and you wait to the last minute with things, you can send them out much later and not have to worry about the time mail takes to get to places on-time!
This tutorial covers using PHP, URL encoded strings, FlahVars, and Flash to send out an address to a simple Flash e-card template that is personalized for each recipients name.
The Lost Art of PHP Control Structures - Part 5: Variables by Reference
by Rob Williams - 15-Jan-07
Reader Level:
One of the key components of any scripting or programming language are control structures; statements that tell a language interpretter to stop reading code in a linear line-by-line fashion and start to make more complex operations based on simple logic. While most developers are aware of the common "if else" and "for" structures, there are many others available in PHP (and other languages I might add) that allow you to save a great deal of time and make your coding more efficient and easier to understand.
In this series we're going to take a look at some of those "forgotten" structures and some practical examples of how they can be used to clean up your coding techniques. We're going to take a bit of a detour from our usual control structures discussions today to explore a slightly more basic but extremely useful technique called variable referencing.
The Lost Art of PHP Control Structures Series:
The Lost Art of PHP Control Structures - Part 1: Switch Statements
The Lost Art of PHP Control Structures - Part 2: The Break Command
The Lost Art of PHP Control Structures - Part 3: Advanced Loops and Arrays
The Lost Art of PHP Control Structures - Part 4: Internal Array Pointers
The Lost Art of PHP Control Structures - Part 5: Variables by Reference
The Lost Art of PHP Control Structures - Part 6:Resource Pointers and One Last Trick
Validating Select Fields
by Gordon Mackay - 08-Jan-07
Reader Level:
One very commonly asked questions when people begin processing data from forms using PHP is "How do I validate select fields and make them sticky?". The solution is very simple, and in this tutorial we will look at two scenarios for validating and creating sticky select form fields.
CMX PHP Download Counter
by Gordon Mackay - 19-Dec-06
Reader Level:
So, your site offers it's users downloadable files of some sort, but you have no way of knowing how many files are being downloaded? Well CMX has has a solution for you.
The CMX PHP Download Counter consists of two tiny PHP functions that use MySQL tables to generate lists of file downloads and count the total file downloads each time someone clicks on the link.
The Lost Art of PHP Control Structures - Part 4: Internal Array Pointers
by Rob Williams - 14-Dec-06
Reader Level:
One of the key components of any scripting or programming language are control structures; statements that tell a language interpretter to stop reading code in a linear line-by-line fashion and start to make more complex operations based on simple logic. While most developers are aware of the common "if else" and "for" structures, there are many others available in PHP (and other languages I might add) that allow you to save a great deal of time and make your coding more efficient and easier to understand.
In this series we're going to take a look at some of those "forgotten" structures and some practical examples of how they can be used to clean up your coding techniques. This time around we'll explore array and resource pointers to see how they work and just how useful they can be.
The Lost Art of PHP Control Structures Series:
The Lost Art of PHP Control Structures - Part 1: Switch Statements
The Lost Art of PHP Control Structures - Part 2: The Break Command
The Lost Art of PHP Control Structures - Part 3: Advanced Loops and Arrays
The Lost Art of PHP Control Structures - Part 4: Internal Array Pointers
The Lost Art of PHP Control Structures - Part 5: Variables by Reference
The Lost Art of PHP Control Structures - Part 6:Resource Pointers and One Last Trick
Multiple Insert/Update in PHP - Part 2
by Tom Muck - 06-Dec-06
Reader Level:
Dreamweaver has some built-in tools for doing database inserts and updates, but they only handle basic inserts/updates of one record. What if you want to insert multiple records at a time, or update multiple records? Dreamweaver is no help in this case, but using PHP the process is simple. The first part of this tutorial showed two often-used methods for doing multiple inserts. Part 2 will show how to do a multiple update using these two techniques.
The Multiple Insert/Update in PHP Series:
Multiple Insert/Update in PHP - Part 1
Multiple Insert/Update in PHP - Part 2
CMX PHP Breadcrumbs
by Gordon Mackay - 06-Dec-06
Reader Level:
As a web site's content grows, so does it's need to ensure that users can navigate around it in the easiest possible ways. In larger web sites it's very simple for users to lose track of their orientation within a site.
Enter breadcrumbs... A very simply way to keep your users oriented, as well as giving them instant access to the pages closest to the one that they're viewing. Using the directory structure of a web site is the easiest way to implement breadcrumbs using PHP. In this tutorial we will look at creating a simple function that will automatically generate a breadcrumb trail in valid and semantic (X)HTML.
The Lost Art of PHP Control Structures - Part 3: Advanced Loops and Arrays
by Rob Williams - 04-Dec-06
Reader Level:
One of the key components of any scripting or programming language is control structures - statements that tell a language interpreter to stop reading code in a linear line-by-line fashion and start to make more complex operations based on simple logic. While most developers are aware of the common "if else" and "for" structures, there are many others available in PHP (and other languages I might add) that allow you to save a great deal of time and make your coding more efficient and easier to understand.
In this series we're going to take a look at some of those "forgotten" structures and some practical examples of how they can be used to clean up your coding techniques. This time around we'll be looking at some more advanced looping techniques that will allow you to make your code more powerful and easier to read.
The Lost Art of PHP Control Structures Series:
The Lost Art of PHP Control Structures - Part 1: Switch Statements
The Lost Art of PHP Control Structures - Part 2: The Break Command
The Lost Art of PHP Control Structures - Part 3: Advanced Loops and Arrays
The Lost Art of PHP Control Structures - Part 4: Internal Array Pointers
The Lost Art of PHP Control Structures - Part 5: Variables by Reference
The Lost Art of PHP Control Structures - Part 6:Resource Pointers and One Last Trick
Generating ATOM feeds with PHP
by Gordon Mackay - 28-Nov-06
Reader Level:
Web site content syndication is a very commonly used method of sending new content updates via desktop software that is able to read and make sense of the XML languages used in RSS and ATOM. These XML files are generically known as "feeds". They are prevalent in most blogging applications and some forums, but recently they have started to appear on almost every site that is updated on a regular basis.
In this tutorial we will look at generating an RSS feed from a very simple MySQL table using PHP.
Multiple Insert/Update in PHP - Part 1
by Tom Muck - 27-Nov-06
Reader Level:
Dreamweaver has some built-in tools for doing database inserts and updates, but they only handle basic inserts/updates of one record. What if you want to insert multiple records at a time, or update multiple records? Dreamweaver is no help in this case, but using PHP the process is simple.
This tutorial will show two often-used methods for doing multiple inserts and multiple update. The files testinsert.php and testinsert2.php are included in the download package showing the final code for both methods. Part 1 of this series will show how to do inserts and Part 2 will show how to do a multiple update using these two techniques.
The Multiple Insert/Update in PHP Series:
Multiple Insert/Update in PHP - Part 1
Multiple Insert/Update in PHP - Part 2
Put a Calendar on Your Web Page - Part 2
by Paul Davis - 17-Nov-06
Reader Level:
Building on the JavaScript calendar, this article adds database interaction with PHP to make the calendar track events. Includes the PHP code and the JavaScript code for the calendar and database interaction.
The Put a Calendar on Your Web Page Series:
Put a Calendar on Your Web Page - Part 1
Put a Calendar on Your Web Page - Part 2
The Lost Art of PHP Control Structures - Part 2: The Break Command
by Rob Williams - 15-Nov-06
Reader Level:
One of the key components of any scripting or programming language are control structures; statements that tell a language interpretter to stop reading code in a linear line-by-line fashion and start to make more complex operations based on simple logic. While most developers are aware of the common "if else" and "for" structures, there are many others available in PHP (and other languages I might add) that allow you to save a great deal of time and make your coding more efficient and easier to understand.
In this series we're going to take a look at some of those "forgotten" structures and some practical examples of how they can be used to clean up your coding techniques. This time around we're going to take a look at the all-important break command.
The Lost Art of PHP Control Structures Series:
The Lost Art of PHP Control Structures - Part 1: Switch Statements
The Lost Art of PHP Control Structures - Part 2: The Break Command
The Lost Art of PHP Control Structures - Part 3: Advanced Loops and Arrays
The Lost Art of PHP Control Structures - Part 4: Internal Array Pointers
The Lost Art of PHP Control Structures - Part 5: Variables by Reference
The Lost Art of PHP Control Structures - Part 6:Resource Pointers and One Last Trick
Hand-Coded User Authentication
by Gordon Mackay - 07-Nov-06
Reader Level:
One of Dreamweaver's most treasured features is its ability to allow developers a quick and painless way to authenticate users via a login form. While this is pretty cool if you don't want to dirty your hands with code, it doesn't allow you much insight into how it actually works.
In this tutorial we will explore hand-coding a small PHP script that allows you to restrict access to pages, and also redirect users to their own personal page when they log into your application. We will use MySQL to store user information.
So, if you're not frightened of some code, and you want to see how sessions can be used to help developers deliver user-specific content please read on.
The Lost Art of PHP Control Structures - Part 1: Switch Statements
by Rob Williams - 03-Nov-06
Reader Level:
One of the key components of any scripting or programming language are control structures, statements that tell a language interpretter to stop reading code in a linear line-by-line fashion and start to make more complex operations based on simple logic. While most developers are aware of the common "if else" and "for" structures, there are many others available in PHP (and other languages I might add) that allow you to save a great deal of time and make your coding more efficient and easier to understand.
In this series we're going to take a look at some of those "forgotten" structures and some practical examples of how they can be used to clean up your coding techniques. First up in the spotlight: the switch structure.
The Lost Art of PHP Control Structures Series:
The Lost Art of PHP Control Structures - Part 1: Switch Statements
The Lost Art of PHP Control Structures - Part 2: The Break Command
The Lost Art of PHP Control Structures - Part 3: Advanced Loops and Arrays
The Lost Art of PHP Control Structures - Part 4: Internal Array Pointers
The Lost Art of PHP Control Structures - Part 5: Variables by Reference
The Lost Art of PHP Control Structures - Part 6:Resource Pointers and One Last Trick
Editable Select Lists Using CMX AutoComplete
by Rob Williams - 25-Oct-06
Reader Level:
One of the most surprising aspects of HTML forms is that there is no way to natively create an editable select list. Developers are forced to either present a fixed value list for the user to choose from, or provide an additional text box to allow the user to enter a new value. Fortunately with a bit of help from the latest version of the CMX Auto Complete Extension we can finally solve this problem quite easily!
Switching CSS Based on Time of Day with PHP
by Gordon Mackay - 24-Oct-06
Reader Level:
Sometimes dynamic code can have advantages when it comes to adding some aesthetic features to a web design. In this example we will build a small PHP function that will output a different CSS link to your pages depending on what time of the day it is. We will also have a look at the best way to deploy this technique in terms of CSS.
We will take advantage of PHP's date function and switch statements to make our function work.
The support files download for this tutorial contain a nice looking example of a CSS header image rotation based on the time of day. It's complete with the 4 PNG files used, CSS files, PHP function and test page.
Approximate download size: 658k
Implementing a Real-Time Chat Application
by Gordon Mackay - 12-Oct-06
Reader Level:
When you look around the internet you will find a multitude of community-style sites that offer their visitors the opportunity communicate via a real-time chat application. Many of those applications are cumbersome and rely on terrible page refreshes every few seconds.
The fact that chatting online is a very important part of building friendship and communication within a community web site makes it no surprise that a frequently asked question on web development forums is "How do I add live chat to my web site?". It's a common question with so many possible answers.
In this tutorial I will introduce you to a free PHP chat application that works in modern browsers and degrades gracefully in the not so modern browsers that some people still persist in using.
This application is special for a number of reasons. To find out just how special it is please read on.
Previewing and Submitting User Content
by Gordon Mackay - 29-Sep-06
Reader Level:
Often when you allow users to send data to a database it's a good idea to allow them to preview their text before it's committed, especially if the data is going to be queried and outputted onto a live HTML document. This is a common feature of many forum, CMS and blogging applications. In this tutorial I will show you how to acheive this using PHP.
Regular Expressions By Example
by Rob Williams - 26-Sep-06
Reader Level:
Regular expressions are a powerful pattern-based tool for searching and manipulating text. Unfortunately for newcomers they can also seem quite complicated and often times be simply overwhelming.
In this article we'll take a bit more of a hands-on approach to regular expressions and see how some of the various symbols and characters of regular expressions can be combined to form patterns that have real world practical uses.
Implementing Gravatars with PHP
by Gordon Mackay - 13-Sep-06
Reader Level:
What with all those blogs, forums, galleries and other applications that allow web site users to add their own comments on pages it was little wonder that someone decided to create universal method of graphically identifying users.
Gravatars are an adaptation of the good ole' fashioned forum "avatar". The main difference with Gravatars is that they are served from a single place, instead of individual servers. The idea being that no matter where you're posting comments, your avatar will always be the same. Also when you change the image it changes everywhere you have left a comment too! Cool huh?
Let's say you have created an application in PHP and you wish to allow your users to take advantage of Gravatars. How would you do this? Let me show you the easiest method.
Introduction to Regular Expressions
by Rob Williams - 11-Sep-06
Reader Level:
One of the most common tasks as a programmer that you'll end up coming across is string manipulation. You can run from it, you can hide from it, but eventually you're going to have to end up doing it (and usually on a fairly frequent basis!). Fortunately, a special set of tools commonly called "regular expressions" can often save you a great deal of time and effort, helping you achieve goals that you never thought possible. The downside, of course, is that you have to learn how to use these "expressions", and they can be quite confusing at times.
In this article we'll take a beginner's look at what regular expressions are and see through examples how they can help you in your day to day tasks.
PHP Formmail Spam Prevention
by Sheri German - 25-Aug-06
Reader Level:
It used to be that there were clear sides in the junk email battle: the spammers and the spammed. I always considered myself a member of the latter group, and then one day I became a member—inadvertently—of the former. I had become a victim of the email injection attack via a PHP formmail script.
In this update to the Dreamweaver Creating and Processing Form series, we'll take a new look at the phpformmail script and demonstrate how to use a key and email value pair to keep your email address out of the html page.
Create a Quick Poll in PHP - Part 2
by Paul Davis - 16-Aug-06
Reader Level:
Add an administration section to the PHP Poll article and learn how to make your poll management easy!
The Create a Quick Poll in PHP Series:
Create a Quick Poll in PHP - Part 1
Create a Quick Poll in PHP - Part 2
Tag Clouds with PHP and MySQL
by Gordon Mackay - 15-Aug-06
Reader Level:
Tag clouds are all the rage these days when it comes to browsing content that's "tagged" with category keywords. They quickly provide users with a visual indication of which categories contain the most information.
Blogs and social linking networks have been quick to utilize this navigation pattern, but whether tag clouds are just the latest craze or a genuinely useful way for users to navigate content is very much a disputed topic.
In this tutorial we will be using some simple PHP and two simple tables from a MySQL database to illustrate a quick and easy method of outputting tag clouds.
Learning PHP - Part 5: An Introduction to Object-Oriented Programming
by Thomas Pletcher - 03-Aug-06
Reader Level:
This article provides an introduction to object-oriented programming (OOP) in PHP 5, as well as a brief overview of the new object-oriented (OO) features introduced since PHP 4. You'll learn how to define classes, instantiate objects and pass object references, and also how to use PHP 5's new clone operator. Additional OO techniques and topics, including inheritance, will be covered in a follow-up article.
The Learning PHP Series:
Learning PHP - Part 1: A Gentle Introduction
Learning PHP - Part 2: All About Arrays
Learning PHP - Part 3: Basic Content Management
Learning PHP - Part 4: Focus on Functions
Learning PHP - Part 5: An Introduction to Object-Oriented Programming
Clever CSS Menus with PHP
by Gordon Mackay - 02-Aug-06
Reader Level:
In this tutorial we will explore making an intelligent CSS menu system using a very simple PHP function.
While techniques exist in CSS that allow people to add current page indication based on body tags with classes applied to them they involve the editing of the individual pages to make them function. They also do not remove the current page's link from the navigation list.
This menu will automatically remove the link from the current page navigation list item and add an ID that will allow it to be styled with a current page indicator of some sort via CSS.
Let's get started.
Create a Quick Poll in PHP - Part 1
by Paul Davis - 01-Aug-06
Reader Level:
Create a quick poll using PHP, MySQL and Dreamweaver.
The Create a Quick Poll in PHP Series:
Create a Quick Poll in PHP - Part 1
Create a Quick Poll in PHP - Part 2 Coming Soon
Full-Text Searching with MySQL and PHP - Part 2: Search Term Highlighting
by Gordon Mackay - 20-Jul-06
Reader Level:
In the last tutorial of this series I showed you how to create a FULLTEXT index in MySQL and created a query with PHP that allowed you to search through dynamic content using a simple form.
In this tutorial I will show you how to style keywords found in content so that they are highlighted for easy reading.
Google is one such search engine that highlights keywords that the user searched for in the pages generated by the search:
This is very useful as it directs the user's eyes directly to the piece of text they are searching for even when it's jumbled up among lots of other words.
In this tutorial we will create the same effect with a tiny addition to the code from the last part of the tutorial.
Making Time-Triggered Scripts
by Rob Williams - 17-Jul-06
Reader Level:
Most developers tend to think of server-side languages as user-driven applications; that is they sit dormant on a server somewhere waiting for a user to connect and make a request before actually doing anything. While this is true on many occasions, there are also times when server-side scripts need to start working without any user intervention. Unfortunately for developers who aren't entirely familiar with server environments and or are just starting out with a language this type of "non-user triggering" is fairly confusing and difficult because there aren't a lot of explanations in the server-side manuals that explain how to do it.
In this article we'll take a look at how you can acheive time-triggered (rather than user-triggered) scripting using PHP and a remote Linux server.
Full-Text Searching with MySQL and PHP
by Gordon Mackay - 13-Jul-06
Reader Level:
As a general rule of thumb, web sites that contain a large amount of content adopt some form of fuctionality that allows users to search through content held within their database.
The methods for searching database content vary from server model to server model and can often be rather complicated. However, if your web site holds its content in a MySQL database, you can very quickly add a simple but effective search mechanism using MySQL's FULLTEXT indexing.
In this tutorial we will look at using FULLTEXT indexing to create a simple content search engine that can quickly be implemented on any web site running PHP and pulling content from a MySQL database.
Creating a Registration Page: Part 3
by Tom Muck - 21-Jun-06
Reader Level:
Dreamweaver contains many built-in tools to aid in quickly building dynamic sites. Part 1 of this series showed the Record Insertion Form Wizard to set up a simple user registration form on a web site. The registration form allows a user to register for a site.
Part 2 showed validation and the user agreement, using more built-in tools of Dreamweaver and a little rudimentary JavaScript. The tutorial will apply equally to PHP, ASP, ColdFusion, and JSP using built in tools.
Part 3 will show how to pass registration details to Paypal or other payment processor for a paid membership-type of site.
The Creating a Registration Page Series:
Creating a Registration Page: Part 1
Creating a Registration Page: Part 2
Creating a Registration Page: Part 3
Creating a Registration Page: Part 2
by Tom Muck - 07-Jun-06
Reader Level:
Dreamweaver contains many built-in tools to aid in quickly building dynamic sites. Part 1 of this series showed how to use the Record Insertion Form Wizard to set up a simple user registration form on a web site. The registration form allows a user to register for a site.
Part 2 will show validation and the user agreement, using more built-in tools of Dreamweaver and a little rudimentary JavaScript. The tutorial will apply equally to PHP, ASP, ColdFusion, and JSP using built in tools.
Part 3 will show how to pass registration details to PayPal or other payment processor for a paid membership-type of site.
The Creating a Registration Page Series:
Creating a Registration Page: Part 1
Creating a Registration Page: Part 2
Creating a Registration Page: Part 3
Creating a Registration Page: Part 1
by Tom Muck - 23-May-06
Reader Level:
Dreamweaver contains many built-in tools to aid in quickly building dynamic sites. One such tool is the Record Insertion Form Wizard. Using this tool, I'll show how to set up a simple user registration form on a web site. The registration form will allow a user to register for a site (free site or membership site), and include a way for the user to agree to a user agreement and also opt-in/opt-out of a newsletter. The tutorial will apply equally to PHP, ASP, ColdFusion, and JSP using built in tools. This is the first part in a series.
Part 2 will show validation and the user agreement, and Part 3 will show how to pass registration details to Paypal or other payment processor for a paid membership-type of site.
The Creating a Registration Page Series:
Creating a Registration Page: Part 1
Creating a Registration Page: Part 2
Creating a Registration Page: Part 3
Create Dynamic Charts & Graphs with PHP/SWF Charts
by Thomas Pletcher - 28-Apr-06
Reader Level:
PHP/SWF Charts is a PHP-based tool to generate Flash charts and graphs from dynamic data. With it, you can create charts that update in real time, right on the same page. This tutorial will show you how to use the free version of PHP/SWF charts (along with PHP and MySQL) to create an opinion poll page where poll results are charted in real time.
Making Full Use of Bindings
by Tom Muck - 31-Mar-06
Reader Level:
The Dreamweaver bindings panel has a lot of uses beyond a place to build recordsets and stored procedures. Many people don't realize that when you add session, request, and application variables to the panel manually, you get some visual advantages — the ability to drag items to the page into design view, the ability to use variables as filters, and the ability to add formatting functions to design view.
This article will explore the bindings panel and its advantages. Because we are discussing core Dreamweaver functionality, the article will apply equally to all server models in Dreamweaver, although some server models have better bindings panel support than others.
Spell Checking HTML Forms with JavaScript and PHP
by Rob Williams - 27-Mar-06
Reader Level:
Have you ever had to write a large amount of text into a field on an HTML form and been uncertain of just how reliable your spelling skills are? Wouldn't it be nice if HTML forms, like most other applications, had one of those handy little "Spell Check" buttons? In this article we'll look at how easy it is to implement this functionality using a PHP/JavaScript solution called Speller Pages.
Speeding up AJAX with JSON
by Joel Martinez - 13-Mar-06
Reader Level:
XML is a brilliant tool for standardizing communication between two isolated systems. When you as a web developer have control over the way that both of those systems function though the benefits of XML quickly begin to fall short of the timing delays that it incurs. This is especially true of AJAX applications where you have control over both the client-side and server-side code, and thus usually don't need to waste the user's time by converting everything to XML and then back again for each transaction.
In this article we'll explore a more compact, and possibly more effective, approach to transferring complex data between two systems using JSON.
AJAX Applied: PHP Contact Forms - Part 2
by Rob Williams - 10-Mar-06
Reader Level:
In the first part of this article we explored how to take a standard PHP-driven contact form and convert it to an AJAX-driven one. Although the AJAX version was better than the original, the conversion over to client-side validation also opened the door for some new and unexpected possibilities.
In this article we're going to explore one of those new concepts and refine our form a bit further by adding form validation that occurs in real-time as the user completes each field.
The AJAX Applied Series:
AJAX Applied: PHP Contact Forms
AJAX Applied: PHP Contact Forms - Part 2
Using JumpStarts with Cartweaver, Featuring Minneapolis
by Tom Muck - 09-Mar-06
Reader Level:
JumpStarts are great starting points for dynamic sites, and the Minneapolis JumpStart is a great starting point for a dynamic e-commerce site. Shopping carts like Cartweaver integrate well with Dreamweaver, but how do you integrate a third-party cart with a JumpStart? This tutorial, written by a member of the Cartweaver team and Community MX, shows one way of integrating the two.
AJAX Applied: PHP Contact Forms
by Rob Williams - 01-Mar-06
Reader Level:
For most web developers AJAX is simply another one of those "buzz words" that represents a "revolutionary new technology" that will change the way web sites work forever. It all sounds fantastic and there are lots of great articles that explain what AJAX is and why you'd want to use it. The biggest problem for most developers is figuring out just how AJAX can be applied to real-world situations.
In this article we're going to try and tackle the implementation question. We'll take an existing PHP contact form and gradually convert it into an AJAX-driven solution. The goal is to demonstrate not only the technology and how it can be used, but also the process that you, as a developer, can take to begin the transition from traditional web development to AJAX-based pages and sites.
The AJAX Applied Series:
AJAX Applied: PHP Contact Forms
AJAX Applied: PHP Contact Forms - Part 2
Geolocating IP Addresses with PHP
by Rob Williams - 23-Feb-06
Reader Level:
Have you ever wondered just where in the world the visitors of your website are comming from? Whether to satisfy your own curiosity or to automatically deliver localized information, Geocoding can open a whole new set of possibilites for a web site. In this article we'll take a look at what Geocoding is and how a community-based project can help to provide an accurate and affordable geocoding solution.
Automating An Image Gallery with PHP and Your Local Server: Part 2
by Rob Williams - 10-Feb-06
Reader Level:
Many developers have local testing servers running on their development machines to allow for quick offline tests of materials before they are sent to the live server. If you happen to be running a local server on your development machine, though, there's no reason that its functionality should be limited to mere page testing. In this, the second part of the series, we'll continue to build upon our Photo gallery management script and complete its functionality by adding both FTP and cURL support.
The Automating an Image Gallery with PHP and Your Local Server Series:
Automating An Image Gallery with PHP and Your Local Server: Part 1
Automating An Image Gallery with PHP and Your Local Server: Part 2
Getting Started with Eclipse - Part 2
by Michelle Kempner - 02-Feb-06
Reader Level:
In the second article of this series, you'll learn how to install Eclipse plug-ins for ColdFusion, PHP, and ActionScript.
The Getting Started with Eclipse Series:
Getting Started with Eclipse - Part 1
Getting Started with Eclipse - Part 2
Getting Started with Eclipse - Part 3
Automating An Image Gallery with PHP and Your Local Server: Part 1
by Rob Williams - 27-Jan-06
Reader Level:
Many developers have local testing servers running on their development machines to allow for quick offline tests of materials before they are sent to the live server. If you happen to be running a local server on your development machine though there's no reason that it's functionality should be limited to mere page testing. In this article we'll take a look at how you can utilize your local server as a scripting engine to increase your efficiency and perform common tasks more quickly then ever before.
The Automating an Image Gallery with PHP and Your Local Server Series:
Automating An Image Gallery with PHP and Your Local Server: Part 1
Automating An Image Gallery with PHP and Your Local Server: Part 2 Coming Soon
WordPress 2.0: Wonderful As Ever
by Thomas Pletcher - 23-Jan-06
Reader Level:
WordPress has always been both powerful and empowering, and the new 2.0 ("Duke") release is no exception. This review discusses the new features in the latest edition of WordPress, and offers tips on installation and/or upgrading.
Running PHP under ASP.NET??
by Joel Martinez - 16-Jan-06
Reader Level:
I won't lie, I am a Microsoft lover. Their technology has been paying my salary for just about my entire career, and C# totally rocks in my quite humble opinion. But that being said, any programmer worth their salt knows that a specific technology is nothing more than a tool. If a given situation could be solved more efficiently with the use of non-Microsoft technology, then its your responsibility to investigate and (potentially) use said technology.
This article is going to review a nifty little project called Phalanger. Installing this on your ASP.NET web server allows you to deploy PHP code, even full applications like phpBB. Behind the scenes, the PHP code will be compiled to .NET code and run as an ASP.NET application.
The best thing about it is that you can, from PHP script, access .NET code (in your language of choice), and vice-versa. So if you have a nifty function written in PHP, you can use it in your .NET application. The Developers tout impressive performance improvements over the native PHP environement so this makes Phalanger an attractive target for your application platform.
PHP and the Filesystem - Part 3: File Contents
by Rob Williams - 13-Jan-06
Reader Level:
PHP provides a wide variety of ways to work with the filesystem of the server upon which it is running. In the third part of this series, File Content , we'll explore how to read and write information to files using a PHP script.
The PHP and the Filesystem Series:
PHP and the Filesystem - Part 1: Directories
PHP and the Filesystem - Part 2: Basic File Control
PHP and the Filesystem - Part 3: File Contents
Captcha the Bastards: Part 2
by Thomas Pletcher - 10-Jan-06
Reader Level:
Captcha PHP is an excellent captcha implementation that will help you get rid of scuzzy comment spammers. This article shows you how to set up a captcha on your local development box, and on your remote server.
The Captcha Series:
Captcha the Bastards: Part 1
Captcha the Bastards: Part 2
PHP and the Filesystem - Part 2: Basic File Control
by Rob Williams - 02-Jan-06
Reader Level:
PHP provides a wide variety of ways to work with the filesystem of the server upon which it is running. In the second part of this series, Basic File Control, we'll explore how to get information about and move/copy/delete files from within a PHP script.
The PHP and the Filesystem Series:
PHP and the Filesystem - Part 1: Directories
PHP and the Filesystem - Part 2: Basic File Control
PHP and the Filesystem - Part 3: File Contents
Creating a Simple Blog: Part 6
by Tom Muck - 22-Dec-05
Reader Level:
There have been five parts in the series on creating a simple blog. The first five parts focused on creating basic functionality to get a basic blog up and running using simple Dreamweaver design tools. This part will show how to incorporate the functionality into a more complex design — specifically, the latest CMX Jumpstart — Inverness. This tutorial will be equally applicable to ColdFusion, ASP, PHP, ASP.NET, or JSP because we will be using standard Dreamweaver server behaviors to create
the blog. In the course of merging the dynamic blog into the design, you'll learn the following about merging content with design in general — how to find repeating items and make them dynamic, how to separate parts of an existing design into a module.
- Creating a Simple Blog: Part 1 22-Mar-04
- Creating a Simple Blog: Part 2 30-Mar-04
- Creating a Simple Blog: Part 3 14-Apr-04
- Creating a Simple Blog: Part 4 25-May-04
- Creating a Simple Blog: Part 5 26-Apr-05
Captcha the Bastards: Part 1
by Thomas Pletcher - 13-Dec-05
Reader Level:
Plagued by comment spammers? Captcha the bastards - a well-designed captcha implementation is your best weapon in the battle against comment and link spam. Part 1 of this article provides an overview of Captcha and introduces you to Captcha PHP, an excellent solution. Part 2 will provide all the setup details.
The Captcha Series:
Captcha the Bastards: Part 1
Captcha the Bastards: Part 2
Redirecting Users When Logging In
by Danilo Celic - 12-Dec-05
Reader Level:
While the article Show and Hide Content Based on User Access Level discusses allowing content for multiple access levels (or user groups) to be held on the same page and showing portions of content based upon the user's group, sometimes you need each user group to get sent to different pages (perhaps within different folders). This article discusses how to enhance the existing Log In User Dreamweaver Server Behavior to allow redirecting users to specific pages based upon their access level when they log in.
A Gentle Introduction to SimpleXML
by Gordon Mackay - 12-Dec-05
Reader Level:
Once upon a time PHP developers wishing to take advantage of XML when building their applications were forced to jump through many hoops in order to parse even the most simple XML documents.
PHP 5 however has proved to be a complete rethink of the way in which PHP is able to handle simple and complex XML documents. It sports a new extension called simpleXML that allows even the most novice of PHP developers to work with XML without the urge to tear their hair from its roots.
In this tutorial we will have a look at how PHP's simpleXML could allow us to utilize XML in the real world of web development.
PHP and the Filesystem Part 1: Directories
by Rob Williams - 08-Dec-05
Reader Level:
PHP provides a wide variety of ways to work with the filesystem of the server upon which it is running. In the first part of this article, Directories, we'll explore how to work with, manipulate, and access directory structures from within a PHP script.
The PHP and the Filesystem Series:
PHP and the Filesystem - Part 1: Directories
PHP and the Filesystem - Part 2: Basic File Control
PHP and the Filesystem - Part 3: File Contents
Preventing Form Flooding and Double Submits
by Gordon Mackay - 05-Dec-05
Reader Level:
When your sites allow users to input data via web forms it involves some risk on your part. One of those risks is flooding.
Flooding occurs when a user repeatedly inserts data in quick succession; either deliberately or by mistake. When flooding occurs by mistake it's usually because the user has either refreshed a page that still has HTTP request POST data set, or they have accidently pressed the form's submit button multiple times, the "double submit problem".
Recently many blogs have been plagued by a form of advertising that takes advantage of the ease in which a site's user can post visible content on a page. It's called "Comment Spam", and although it's almost impossible to prevent it can be limited to an extent by taking some simple measures to limit the rate in which people can send data via your forms.
In this article we will explore two methods that will ensure that you will never suffer the consequences of the double submit problem, and hopefully limit the impact of malicious user input.
Confirmation Emails
by Rob Williams - 02-Dec-05
Reader Level:
Many sites and services require that you confirm your email address when creating accounts or subscribing to services for the first time. Although there are a fair number of ways that you can attempt to validate a supplied email address, the only real way to be sure of its validity is to use a confirmation email. In this article we'll take a look at how you can create such a confirmation system using PHP and MySQL.
Show and Hide Content Based on User Access Levels
by Danilo Celic - 23-Nov-05
Reader Level:
Dreamweaver's native Log In User server behavior combined with the Restrict Access to Page server behavior can help you protect your pages from prying eyes. However, when it comes to more fine grained control of content on pages viewable by users from multiple access levels, Dreamweaver doesn't have anything built in to offer any assistance to you.
Read on to learn how to show and hide content on a page based upon the access level (user group) of a logged in visitor.
Reading Flash Metadata with PHP
by Rob Williams - 21-Nov-05
Reader Level:
Flash 8 is the first version of the SWF file format to support standardized, native metadata. This is a great new feature that has the potential to make SWF files easier to manage, organize, and even locate through search engines. Unfortunately there's one small catch; although Flash 8 has made adding metadata to your SWF files extremely simple, at the time of writing there are very few applications/scripts/bots outside of Flash itself that actually have the ability to read that metadata!
In this article we'll take a look at a custom PHP class that can be used to read SWF metadata, and how it can be used to realize some of these great new potentials.
Overcomming File Restrictions with PHP
by Rob Williams - 08-Nov-05
Reader Level:
PHP offers a wide variety of file manipulation functions that can be used to create online content management systems as well as web-based control panels. One of the problems that many developers face when first implementing this type of solution though is file permissions. In this article we'll take a look at file permissions on UNIX-style servers, why they can be a hinderance to web-based administrative scripts, and how to overcome the problems that they can create.
PHP Contact Forms - Part 2
by Gordon Mackay - 07-Nov-05
Reader Level:
In the first part of this tutorial we made a contact form using PHP's mail() function. In the process of creating our script to send the mail to your inbox we checked each of the form's fields to ensure they contained the data required.
In this second part of the tutorial we will look closely at CSS and some more PHP which will improve the way our form functions and looks.
The PHP Contact Forms Series:
PHP Contact Forms - Part 1
PHP Contact Forms - Part 2
PHP Contact Forms - Part 1
by Gordon Mackay - 28-Oct-05
Reader Level:
The ability to receive feedback or enquiries from the people who visit your web site is always beneficial. If your site is hosted on a server running PHP, the creation of mail forms is a relatively simple task, made easier by one of PHP's built-in functions, the mail() function.
The PHP Contact Forms Series:
PHP Contact Forms - Part 1
PHP Contact Forms - Part 2
Teaching Dreamweaver Part 2
by Sheri German - 11-Oct-05
Reader Level:
Part two of my Dreamweaver course series is devoted to how I teach students to create database-driven web pages and web applications. During the course of the semester we put together a form that is processed by a script, a login system based on access level that uses Dreamweaver's Authentication Server Behaviors, and a blog as introduced in a tutorial by Tom Muck. In the process, the students learn the basics of the various skills they'll use: form construction, SQL, database and web application design, and server model concepts.
Random Queries (recordsets) For ASP, ColdFusion and PHP
by Danilo Celic - 29-Sep-05
Reader Level:
While most data displays on web sites are in some predetermined, or even user specified order, such as search results of a products table in product name order, it can be quite beneficial to display data randomly, such as random banners, or even random on sale products on the home page. This article will discuss how you can use ASP VBScript with Access and MS SQL Server; PHP with MySQL; and ColdFusion with Access, MS SQL Server and MySQL to generate random results, be it a single random banner from your advertisers, or five random products that are currently on sale.
Using PHP to Enable Client-Side Web Services
by Rob Williams - 17-Aug-05
Reader Level:
You've just finished reading up about JavaScript's XMLHTTPRequest object when the light bulb goes on: Moving over to using XMLHTTPRequest has inadvertently forced you to deploy your own little web service! After all, if you think about it a web service is merely a remote server that you send and receive data from in a standardized format (usually XML). That's neat, but ultimately the next question arises: if a client uses XMLHTTPRequest to connect to your "web service" is it possible to use that same methodology (and code) to connect to any other public web service? If you've already gone ahead and tried this though you'll find that it's one of those "it should work but doesn't for some strange reason" problems. In this article we'll take a look at why it doesn't work quite the way you'd expect and a neat little solution to overcome the problem.
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
by Joey Lott - 02-Aug-05
Reader Level:
In Part 9 we'll build some new functionality into the PHP Photograph Gallery application. Specifically, we'll use PHP to dynamically draw frames around thumbnail images, and we'll add a watermark to the one-up view images.
The PHP Image Series:
PHP Image Series: Part 1 - Basic Drawing
PHP Image Series: Part 2 - Fills
PHP Image Series: Part 3 - Gradients
PHP Image Series: Part 4 - Text
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
PHP Image Series: Part 6 - Building a Photographic Album
PHP Image Series: Part 7 - Building a Photographic Album (Continued)
PHP Image Series: Part 8 - Building a Photographic Album (Continued)
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
Introducing Recursive Functions in PHP
by Rob Williams - 01-Aug-05
Reader Level:
One of the basic building blocks of any object-oriented programming language is the function. Functions allow you to reuse blocks of code and perform common tasks from other points within a script. In addition to straight calls though, functions can also be created to act recursively, adding a whole new dimension and power to this basic programming building block. In this article we'll take a look at what recursion is and why it's useful. We'll also create a recursive function to convert PHP arrays to JavaScript ones.
Learning PHP - Part 4: Focus On Functions
by Thomas Pletcher - 27-Jul-05
Reader Level:
In this installment of the Learning PHP series, the focus is on using functions to enhance the accuracy and efficiency of your code.
The Learning PHP Series:
Learning PHP - Part 1: A Gentle Introduction
Learning PHP - Part 2: All About Arrays
Learning PHP - Part 3: Basic Content Management
Learning PHP - Part 4: Focus on Functions
Dynamic CSAs - Part 4: Completing the Notepad
by Rob Williams - 21-Jul-05
Reader Level:
Dynamic Client-Side Applications are an exciting and new way of developing for the web. In the previous part of this series we began to build our first complete Dynamic CSA in the form of a small Notepad application. When last we left off we'd just completed adding the client-side interactivity to our notepad, allowing the user to drag it around on screen and clear the contents. This time we'll use the server communications skills we covered in Part 2 to tie our notepad into some server-side scripting and give it some "page-resilience".
The Dynamic CSAs Series:
Dynamic CSAs - Part 1: Interactivity Events
Dynamic CSAs - Part 2: Client/Server Communication
Dynamic CSAs - Part 3: Bringing it All Together
Dynamic CSAs - Part 4: Completing the Notepad
PHP Image Series: Part 8 - Building a Photograph Gallery Application (Continued)
by Joey Lott - 18-Jul-05
Reader Level:
In Part 8 you'll continue building the photograph gallery application started in Parts 6 and 7. Browse thumbnails, view photographs, and more.
The PHP Image Series:
PHP Image Series: Part 1 - Basic Drawing
PHP Image Series: Part 2 - Fills
PHP Image Series: Part 3 - Gradients
PHP Image Series: Part 4 - Text
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
PHP Image Series: Part 6 - Building a Photographic Album
PHP Image Series: Part 7 - Building a Photographic Album (Continued)
PHP Image Series: Part 8 - Building a Photographic Album (Continued)
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
Base64 Encoding
by Joel Martinez - 12-Jul-05
Reader Level:
Your boss comes up to you, says that the requirements on the latest project have changed. You are now required to include an employee badge photo along with your company's replication feed. "But sir, the replication feed is an XML file ... how are we going to get an image into that?".
Enter Base64 Encoding. Though it doesn't come up every day, it's usefulness is undeniable, and your toolbox will be all the better for containing it. Code presented in this article will be in ASP.NET, Coldfusion, and PHP. We will discuss some situations where Base64 encoding will come in handy.
CMX JumpStart: Vienna
by Sheri German - 06-Jul-05
Reader Level:
Last summer we took a trip to Germany and Austria with our son's orchestra director. My favorite city was Vienna, Austria. So it is only natural that I should choose Vienna for my city as I "change hats" from JumpStarts marketer to JumpStarts creator. I am particularly pleased and excited to offer our latest CMX JumpStart: Vienna.
In addition to the use of valid XHTML 1.0 and CSS 2.1, and in addition to validating for 508 and WAI, we have a number of special features in Vienna. This three column layout has two outer columns with fixed widths, a fluid center column for content, and fluid header and footer. There are also unordered lists for navigation: one for the main navigation, one for the sub navigation, and one for the footer navigation. We have also added a search field into an area that is at the top of the page outside the main centered layout. So far, reasonably cool, right?
But hold on. We have something far more exciting to reveal with this JumpStart. We will introduce a new and revolutionary technique called Jello Mold that has an implied minimum and maximum width that works in Internet Explorer without the use of Javascript! Furthermore, this technique allows for fluid margins on the fluid centered layout that depend on the size of the user's window.
The download folder for this article includes a bundle of 11 articles (including two about Jello Mold technique), a starter page, an images folder, four style sheets (including design-time and print), a source png, the Vienna extension, an installation and usage guide, and this article as a PDF.
Learning PHP - Part 3: Basic Content Management
by Thomas Pletcher - 17-Jun-05
Reader Level:
In Part 3 of the Learning PHP series, you'll learn how to use PHP and MySQL to build a basic, working content management system that you can customize for any site.
The Learning PHP Series:
Learning PHP - Part 1: A Gentle Introduction
Learning PHP - Part 2: All About Arrays
Learning PHP - Part 3: Basic Content Management
Learning PHP - Part 4: Focus on Functions
Creating a Search Engine with iSearch
by Sheri German - 08-Jun-05
Reader Level:
If you have always wanted to add a search engine to your site, and didn't know how to program one yourself, you might want to download and install iSearch, a ready-made PHP and MySQL driven application that performs searches right on your own server. This tutorial will take you through the installation and the customization (of the style sheet and header and footer includes) of iSearch.
PHP Image Series: Part 7 - Building a Photograph Gallery Application (Continued)
by Joey Lott - 27-May-05
Reader Level:
In Part 7 you'll continue building the photograph gallery application started in Part 6. Browse thumbnails, view photographs, and more.
The PHP Image Series:
PHP Image Series: Part 1 - Basic Drawing
PHP Image Series: Part 2 - Fills
PHP Image Series: Part 3 - Gradients
PHP Image Series: Part 4 - Text
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
PHP Image Series: Part 6 - Building a Photographic Album
PHP Image Series: Part 7 - Building a Photographic Album (Continued)
PHP Image Series: Part 8 - Building a Photographic Album (Continued)
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
Learning PHP - Part 2: All About Arrays
by Thomas Pletcher - 18-May-05
Reader Level:
Everyone knows PHP offers a wide array of web development possibilities. In Part 2 of our Learning PHP series, we'll see just how wide: this installment is all about arrays, and how to use them.
The Learning PHP Series:
Learning PHP - Part 1: A Gentle Introduction
Learning PHP - Part 2: All About Arrays
Learning PHP - Part 3: Basic Content Management
Learning PHP - Part 4: Focus on Functions
PHP Image Series: Part 6 - Building a Photograph Album
by Joey Lott - 12-May-05
Reader Level:
In Part 6 of the PHP Image Series we will start building an application utilizing the topics discussed in the previous aritcles in the series. The application is a photograph gallery that has features such as batch upload (using ZIP files,) dynamic borders, watermarks, and graphs. In this article we'll build the basic database structure for the tables that will hold the photograph, album, and category data. Additionally, we'll build the PHP interfaces for adding albums, categories, and uploading photographs.
The PHP Image Series:
PHP Image Series: Part 1 - Basic Drawing
PHP Image Series: Part 2 - Fills
PHP Image Series: Part 3 - Gradients
PHP Image Series: Part 4 - Text
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
PHP Image Series: Part 6 - Building a Photographic Album
PHP Image Series: Part 7 - Building a Photographic Album (Continued)
PHP Image Series: Part 8 - Building a Photographic Album (Continued)
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
by Joey Lott - 29-Apr-05
Reader Level:
In Part 5 of the series learn how to use bitmapped images such as JPEG and PNG, and how to composite images to apply things such as watermarks. You'll even build a simple application in which the user can upload an image, scale the image, and apply a watermark.
The PHP Image Series:
PHP Image Series: Part 1 - Basic Drawing
PHP Image Series: Part 2 - Fills
PHP Image Series: Part 3 - Gradients
PHP Image Series: Part 4 - Text
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
PHP Image Series: Part 6 - Building a Photographic Album
PHP Image Series: Part 7 - Building a Photographic Album (Continued)
PHP Image Series: Part 8 - Building a Photographic Album (Continued)
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
Creating a Simple Blog - Part 5
by Tom Muck - 26-Apr-05
Reader Level:
One of the frequent questions in the forums is "How do I create a blog?". There are many commercial blog systems out there, and many full-featured blog providers, like Blogger, but you can also create a simple blog using the standard tools of Dreamweaver. This tutorial will be equally applicable to ColdFusion, ASP, PHP, ASP.NET, or JSP because we will be using standard Dreamweaver server behaviors to create the blog. This fifth part of the series will describe how to add a design to the blog, including a sidebar with category, blogroll, and RSS modules.
Learning PHP - Part 1: A Gentle Introduction
by Thomas Pletcher - 20-Apr-05
Reader Level:
A basic introduction to PHP, placing the language in context vis-a-vis its competitors, and providing syntax and usage examples — including connecting to, and displaying data from, a MySQL database.
The Learning PHP Series:
Learning PHP - Part 1: A Gentle Introduction
Learning PHP - Part 2: All About Arrays
Learning PHP - Part 3: Basic Content Management
Learning PHP - Part 4: Focus on Functions
PHP Image Series: Part 4 - Text
by Joey Lott - 15-Apr-05
Reader Level:
In Part 4 of the PHP image series you'll learn how to add text to images. The article discusses how to use both bitmap and TrueType fonts, and how to determine the dimensions of the text.
The PHP Image Series:
PHP Image Series: Part 1 - Basic Drawing
PHP Image Series: Part 2 - Fills
PHP Image Series: Part 3 - Gradients
PHP Image Series: Part 4 - Text
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
PHP Image Series: Part 6 - Building a Photographic Album
PHP Image Series: Part 7 - Building a Photographic Album (Continued)
PHP Image Series: Part 8 - Building a Photographic Album (Continued)
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
Dynamic CSS Files with PHP
by Rob Williams - 11-Apr-05
Reader Level:
Dynamically generated CSS adds a whole new level of managability and optimization to CSS. In this article we'll take a look at how to put PHP scripting within your CSS files, and some of the advantages of doing so.
PHP Images Series: Part 3 - Gradients
by Joey Lott - 31-Mar-05
Reader Level:
In the third article in the series, learn how to apply gradients using PHP. Although PHP doesn't have any built-in functions for gradients, in this article you'll learn the basics of how to make gradients manually.
The PHP Image Series:
PHP Image Series: Part 1 - Basic Drawing
PHP Image Series: Part 2 - Fills
PHP Image Series: Part 3 - Gradients
PHP Image Series: Part 4 - Text
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
PHP Image Series: Part 6 - Building a Photographic Album
PHP Image Series: Part 7 - Building a Photographic Album (Continued)
PHP Image Series: Part 8 - Building a Photographic Album (Continued)
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
Basic FTP in Your PHP Scripts
by Rob Williams - 28-Mar-05
Reader Level:
Although many developers regard PHP simply as a tool for dynamic web sites, there are many situations in which it can be used to make a web administrator's job easier and more efficient. In this article, we take a look at PHP's native FTP functionality, and how it can be used to help automate the task of creating and updating a Froogle data feed.
PHP Images Series: Part 2 - Fills
by Joey Lott - 22-Mar-05
Reader Level:
In this second article in a series, learn how to apply fills to shapes in PHP. You'll learn how to apply solid fills not only to rectangles and ellipses, but also to arcs and custom shapes.
The PHP Image Series:
PHP Image Series: Part 1 - Basic Drawing
PHP Image Series: Part 2 - Fills
PHP Image Series: Part 3 - Gradients
PHP Image Series: Part 4 - Text
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
PHP Image Series: Part 6 - Building a Photographic Album
PHP Image Series: Part 7 - Building a Photographic Album (Continued)
PHP Image Series: Part 8 - Building a Photographic Album (Continued)
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
PHP Site Simplification with Application.php
by Tom Muck - 15-Mar-05
Reader Level:
PHP and ColdFusion have many things in common, but they also have many differences. One of the nice features of ColdFusion that I wish I had in PHP is the Application.cfm. In the Application.cfm file, you can include things that need to be on every page, such as variables that contain connection information, often-used functions, login functionality, class instantiation, session starting, and form field cleaning, among other things. In ColdFusion, the Application.php file is automatically executed before any code on your page. To mimic this functionality in PHP, I like to create an Application.php file that I include on all my PHP pages. This article will show how an Application.php file can be used to simplify some aspects of your PHP application.
PHP Images Series: Part 1 - Basic Drawing
by Joey Lott - 09-Mar-05
Reader Level:
In this series you'll learn how you can programmatically work with images using PHP. In Part 1, learn how to use some basic PHP drawing functions to dynamically make images with lines, rectangles, ellipses, and more.
The PHP Image Series:
PHP Image Series: Part 1 - Basic Drawing
PHP Image Series: Part 2 - Fills
PHP Image Series: Part 3 - Gradients
PHP Image Series: Part 4 - Text
PHP Image Series: Part 5 - Bitmapped Images, Compositing, and Watermarks
PHP Image Series: Part 6 - Building a Photographic Album
PHP Image Series: Part 7 - Building a Photographic Album (Continued)
PHP Image Series: Part 8 - Building a Photographic Album (Continued)
PHP Image Series: Part 9 - Building a Photograph Gallery Application (Continued)
DOM: Scripting to the Standard - Part 3
by Rob Williams - 04-Mar-05
Reader Level:
The third part of this series focuses on how to change and manipulate a document using DOM methods and properties. We also explore how these techniques can be used by JavaScript's DOM implementation to add some real flexibility to your web pages without having to constantly force the user to wait for page reloads and server-side scripts.
The DOM: Scripting to the Standard Series:
DOM: Scripting to the Standards - Part 1
DOM: Scripting to the Standards - Part 2
DOM: Scripting to the Standards - Part 3
CMXMail: Creating a Generic Mail Class in PHP - Part 2
by Tom Muck - 01-Mar-05
Reader Level:
PHP has a lot of built-in functions, but for dealing with emails it is not the most friendly language, including only a generic mail() function. A way around these limitations is to use an email class to handle setting up the messages and sending them so that you don't have to create custom headers each time you use the mail() function.
Part 1 of this tutorial showed how to create a basic class. Part 2 will add to that class, and also show how to use the class in a loop, effectively creating a newsletter engine to send emails to a database.
The tutorial assumes you have set up databases and connections from PHP to MySQL.
PHP Zip
by Joey Lott - 22-Feb-05
Reader Level:
Learn how to read ZIP archives using PHP. In this article you'll learn the basics of reading data from ZIP archives, and how to extract the files, and recreate the directory structure.
Liverpool JumpStart with .NET
by Heidi Bautista - 31-Jan-05
Reader Level:
Ah yes, Liverpool, not only a great JumpStart, but now you can have it with ASP.NET support. In addition to a valid CSS2 and XHTML 1.0 Transitional, WAI and 508 Accessible CSS layout, you also get a dynamic ASP.NET login application. The original release of the Liverpool JumpStart comes bundled with ColdFusion, PHP, and ASP and uses Dreamweaver's built-in User Authentication Server Behaviors. Unfortunately, Dreamweaver doesn't boast similar server behaviors for ASP.NET. To help make up for that lack, here's a special tutorial just for you ASP.NET coders. I've taken the original Liverpool JumpStart pages and added the necessary ASP.NET code. The result: an out-of-the-box ASP.NET login solution combined with a versatile layout. What could be better? :-)
Included in the support files are the CF, ASP and PHP versions of the Liverpool JumpStart. There is a link at the end of the article that will allow you to download just the .NET version if you prefer, as well as a link to download the bundled tutorials that were included with the original Liverpool JumpStart.
The .NET version of Liverpool is available as a no charge upgrade to purchasers of the original Liverpool JumpStart.
If you would like to receive the .NET version, please send us an email and we will send you the .NET files. Please be sure to include your name and the email address that is associated with the PayPal account used to make the purchase.
CMXMail: Creating a Generic Mail Class in PHP - Part 1
by Tom Muck - 31-Jan-05
Reader Level:
PHP has a lot of built-in functions, but for dealing with emails it is not the most friendly language, including only a generic mail() function. You have to create your own mail headers, set up separate text and HTML messages if you want to send multipart messages, and add your own attachment code. One way around this is to use an email class to handle setting up the messages and sending them so that you don't have to create custom headers each time you use the mail() function. Part 1 of this tutorial will show how to create a basic class that you can later add to.
Announcing CMX JumpStart: Liverpool
by Sheri German - 20-Jan-05
Reader Level:
It was the early sixties, and all the world was in a frenzy over a new group from Liverpool, England called The Beatles. They revolutionized rock 'n' roll music, and the world has never been the same. Maybe the Web Standards movement doesn't stir quite that much excitement, but it is changing the Web world all the same. And because we "love you, yeah, yeah, yeah" we're here to help you join the revolution.
Community MX is pleased to announce the release of its fifth CMX JumpStart: Liverpool. This time we're giving you more than a CSS layout, however. We're also giving you a dynamic ColdFusion login application built with Dreamweaver's User Authentication server behaviors that will allow you to quickly and easily edit the login.
This article will tell you all about what this fantastic package includes--bundled tutorials, an authentication system, a two-column, fixed width layout (with a little bit of a twist), original PNG files, and more.
Access Level and Login For PHP
by Tom Muck - 19-Jan-05
Reader Level:
Dreamweaver has many tools to help simplify page creation. Beginning with Dreamweaver MX 2004, Dreamweaver contains Server Behaviors for password protecting PHP pages in your site. This tutorial will show how to password protect your pages using a username, password, and access level defined in a MySQL database.
Handling File Uploads With PHP
by Rob Williams - 17-Jan-05
Reader Level:
Whether you want to give your web site visitors the ability to manage their own content or simply to post pictures for personal photo galleries, knowing how to handle file upload forms is an important and extremely useful skill to have. In this article, we'll take a look at how file uploads work and how to handle them in PHP.
Creating a Subscribe / Unsubscribe Feature Using PHP and MySQL
by Joey Lott - 12-Jan-05
Reader Level:
Want to add a mailing list to your site? Learn how to do just that by enabling people to subscribe and unsubscribe via a PHP interface with a MySQL database. This article shows you how you can create a database, send automatic emails when people subscribe and unsubscribe, validate email addresses with JavaScript, and more.
On the Fly: Generating PDFs From PHP
by Thomas Pletcher - 30-Dec-04
Reader Level:
There are a number of ways you can create PDF files from PHP, and this introductory article will examine several. We'll show you how to enable PHP PDF generation on local and remote servers, and how to generate text, draw shapes, include images and build tables. A follow-up article will outline the process dynamic PDF generation using templates.
Dreamweaver Piece by Piece Part 5: Creating and Processing Basic Forms Part 2
by Sheri German - 17-Dec-04
Reader Level:
In the first part of our basic forms series, we learned how to configure Dreamweaver form preferences, set up the form with the proper actions and method, and use many of the different kinds of form objects such as text field, textarea, radio groups, and checkboxes.
In this second article in the series, we'll look at the menu/list form object, add our submit and reset buttons, use the validate form behavior, learn to set file permissions, and configure our PHP form processor. Also included in this article are both a ColdFusion and an ASP form processor for those who do not have PHP available on their servers.
Dreamweaver Piece by Piece: Part 4 - Creating and Processing Basic Forms
by Sheri German - 08-Dec-04
Reader Level:
The ability to interact with users is one of the great lures of the Internet for businesses and individuals. Most of you have filled out a form on the Internet, then hit the submit button to send your data off into cyberspace. How is it done? Most instructions give the old "setting up the script is beyond the scope of this tutorial" line, which has long been a frustration to many Web designers. I hope that this article helps you set up a feedback form that actually works. In part one of this series, we'll configure Dreamweaver form preferences, set up our form, and cover most of the different types of form objects developers will use when creating interfaces for interacting with users.
Using Image Metadata in PHP - Part 2
by Rob Williams - 22-Nov-04
Reader Level:
In Part
1 we took at look how to read metadata from images in PHP using the JPEG-Meta class. This time around we take a look at how to use the same class to write and update metadata back to our images, giving us a complete JPEG metadata solution for our PHP applications.
Using Image Metadata in PHP
by Rob Williams - 08-Nov-04
Reader Level:
The rise of the digital camera has brought significant changes to the way in which we interact with and experience images. Most web-based photo galleries though don't begin to explore the full potential of digital pictures. This week we'll take a look at the importance of metadata, and how we can use it in PHP to make our digital images more portable, better organized, and more effective to our viewers.
A Clean Start: The New PHP 5 SOAP Extension
by Thomas Pletcher - 01-Nov-04
Reader Level:
PHP 5 now comes with its own SOAP extension, and that makes implementing cross-platform web services solutions easier than ever. This article will show you how to enable and use the new extension to create a basic web service client that taps the power of Google's Search API.
Using Flash Remoting with PHP: AMFPHP
by Joey Lott - 19-Oct-04
Reader Level:
Flash Remoting is the way to build Flash applications that interact with a business tier on the server. It is fast, efficient, and scalable. In this article learn how to use the free AMFPHP Flash Remoting gateway in order to get started building more sophisticated applications.
PHP Server Communications Using cURL
by Rob Williams - 12-Oct-04
Reader Level:
In today's world of web services and real-time inter-server communications, it's easy to get lost in the wide array of possibilities and technologies that are available for server-side data sharing. In PHP, the ability to use Client URLs directly inside regular scripts provides a powerful but simple solution to a wide variety of server communications scenarios. In this article, we'll take a look at what Client URLs are, how they work, and some of the ways they can be used to create a more complete web experience for end users.
Basic String Manipulation
by Rob Williams - 01-Oct-04
Reader Level:
Working with text, or "strings", is one of the most important skills a new developer can learn. In this article we'll take a look at strings, how and why they are so useful, and get a feel for working with them in PHP. Beginning with the basics of creating strings and converting from other data types, to gathering more information and doing some basic manipulation using the native PHP string functions, this article will give you a good base for working with strings in PHP.
Parallel PHP: Running PHP 4 and PHP 5 on the Same Computer - Part 2
by Thomas Pletcher - 21-Sep-04
Reader Level:
The advances in PHP 5 take the language to a new level, yet most of the world is still running PHP 4. Here's how to have the best of both worlds on one development machine. Part 1 of this article showed you how to add PHP 5 to an existing PHP 4 installation on OS X, and seamlessly switch between the two. Now, Part 2 shows you how to do the same on Windows.
Parallel PHP: Running PHP 4 and PHP 5 on the Same Computer - Part 1
by Thomas Pletcher - 07-Sep-04
Reader Level:
The advances in PHP 5 take the language to a new level, yet most of the world is still running PHP 4. Here's how to have the best of both worlds on one development machine. Part 1 of this article shows you how to add PHP 5 to an existing PHP 4 installation on OS X, and seamlessly switch between the two. Part 2 will show you how to do the same on Windows.
MySQL Command Line Tips
by Thomas Pletcher - 24-Aug-04
Reader Level:
MySQL is all the rage these days, and with good reason: its price/power ratio can't be matched. And there are a lot of well-engineered GUI interfaces to make MySQL administration easy. But the fact remains that MySQL's native interface is the command line, and sometimes the command line is the only way to go.
This article walks you through basic MySQL command-line options on diverse operating systems, and shows you how to get up close and personal with MySQL on your local machine and your remote server.
Working with Times and Dates In PHP
by Rob Williams - 24-Aug-04
Reader Level:
One of the most common tasks to perform with server-side scripting is the automation of management and site maintenance over time. In this article we'll take a look at how PHP handles time and date values and how they can be used to make your PHP projects more automated and self-reliant.
Creating A Photo Blog in PHP - Part 2
by Justin Kozuch - 13-Aug-04
Reader Level:
What good is a blog with no content? Not much good I'm afraid! So today, we will solve your problem of having no content.
Today, we are going to setup the pages that will allow you to not only add new entries, but manage them as well, either through editing existing blog entries, or by deleting ones you don't like.
BBEdit: The Basics and Beyond - Part 2
by Thomas Pletcher - 11-Aug-04
Reader Level:
In Part 1 of this article, we toured BBEdit's basic setup and core capabilities and learned why it's widely regarded as a great HTML editor. Part 2 takes BBEdit to the next level, showing you how to leverage its extensibility with AppleScript to create a lean, mean PHP-coding machine, and a perfect partner for Dreamweaver on the Mac.
Dynamic Graphic Menus with PHP
by Rob Williams - 06-Aug-04
Reader Level:
The trade-off in web design has always been beauty or ease of maintenance. Graphical navigation systems tend to look more appealing than straight text, but are also much more difficult and tedious to maintain and update. However, by utilizing PHP's built-in image manipulation functions, we can now effectively create a graphical navigation system that is both easy to maintain and simple to update...
Creating A Photo Blog in PHP: Part 1
by Justin Kozuch - 02-Aug-04
Reader Level:
Doesn't it seem that everyone and their grandma has a blog these days? Blog, blog, blog. That's all people talk about lately.
Today, you and I will use Dreamweaver, and a host of other tools, to start building a different kind of blog. A photo blog!
Curious? Intrigued? Scared? Think you can't do it? I'll bet you Jim's camera that you can! And I'm going to show you how.
Let's get our photo phreak on!
CMX Download Repeat Region Extension
by Tom Muck - 22-Jul-04
Reader Level:
This extension allows a user to create a downloadable CSV (comma-separated values) or other type of text file that contains the contents of a standard Dreamweaver Repeat Region server behavior (such as a server-side recordset). The extension can also be applied to any server-side content that you want to make downloadable in the browser. This is very useful for creating downloadable files of a results display, such as a product list, a sales report, or a search result.
Manipulating Images On The Fly With PHP
by Rob Williams - 21-Jul-04
Reader Level:
Server-side scripting has made HTML pages dynamic and adaptable, but for the most part has left the tasks of graphic updates and manipulation up to the hard working web developer. Thanks to the simple, yet powerful, image manipulation functions built into PHP though, those hours of repetitive graphic updates can be spent on better things. This article provides an introduction to PHP's image capabilities and gives you a solid foundation of how to create, work with, and save images from within PHP.
Communicating Between PHP and JavaScript
by Rob Williams - 25-Jun-04
Reader Level:
One of the great mysteries of web coding seems to be trying to figure out how, if possible, you can pass information from a server-side scripting lanuage (PHP) to a client-side language (JavaScript); and even more elusively, how to pass information back again. In this article, we're going to solve the age old riddle and discover several possible solutions to the problem.
Creating a Simple Blog Part 4
by Tom Muck - 25-May-04
Reader Level:
One of the frequent questions in the forums is "How do I create a blog?". There are many commercial blog systems out there, and many full-featured blog providers, like Blogger, but you can also create a simple blog using the standard tools of Dreamweaver. This tutorial will be equally applicable to ColdFusion, ASP, PHP, ASP.NET, or JSP because we will be using standard Dreamweaver server behaviors to create the blog. This fourth part of the series will describe how to add categories to the blog by modifying the pages you've already created and also how to display the number of comments on each item.
Creating a Simple Blog Part 3
by Tom Muck - 14-Apr-04
Reader Level:
One of the frequent questions in the forums is "How do I create a blog?". There are many commercial blog systems out there, and many full-featured blog providers, like Blogger, but you can also create a simple blog using the standard tools of Dreamweaver. This tutorial will be equally applicable to ColdFusion, ASP, PHP, ASP.NET, or JSP because we will be using standard Dreamweaver server behaviors to create the blog. Part 3 will focus on adding more features to the blog, such as an RSS feed, individual blog item pages, and how to automatically insert dates.
Creating a Simple Blog Part 2
by Tom Muck - 30-Mar-04
Reader Level:
One of the frequent questions in the forums is "How do I create a blog?". There are many commercial blog systems out there, and many full-featured blog providers, like Blogger, but you can also create a simple blog using the standard tools of Dreamweaver. This tutorial will be equally applicable to ColdFusion, ASP, PHP, ASP.NET, or JSP because we will be using standard Dreamweaver server behaviors to create the blog. Part 1 of the tutorial can be found at http://www.communitymx.com/abstract.cfm?cid=7CC52. Part 2 will focus on adding more features to the blog, such as a system for adding and viewing comments, and more administration options.
Invitations: The 21st Century Way!
by Justin Kozuch - 26-Jan-04
Reader Level:
Traditionally, invitations to an event, such as a wedding or a technology show, are sent out via postal mail. Sometimes, invitations get lost in the process, or they are misplaced by the recipient.
Today, I will show you how to create an RSVP script that will allow you to manage all your RSVPs without having to incur the expense of stamps or worse, lost invitations!
Setting Up A Testing Server For The PHP Server Model: Part II
by Justin Kozuch - 15-Jan-04
Reader Level:
In my previous article, we learned how to set up a testing server for the PHP server model. This allows you the opportunity to test your PHP pages locally for bugs and errors in your programming. We also learned how to set up Dreamweaver MX 2004 to use the MySQL testing server you've previously installed. In this second part, we will set up a Graphical User Interface (GUI) so that you can add new databases and tables to your newly installed local MySQL server to further extend your resources.
Setting Up A Testing Server For The PHP Server Model
by Justin Kozuch - 26-Dec-03
Reader Level:
Once you have created your site in Dreamweaver MX 2004, you have the option of testing it locally for any bugs, errors or to make changes to the way your pages display in the browser. This is usually done before the site is uploaded to the server. However, in order to test your site locally before uploading, you need to set up a testing server. This article will show you in detail how to setup a testing server in Dreamweaver MX 2004 for the PHP server model.
The Insert Record Server Behavior in Dreamweaver MX 2004
by Justin Kozuch - 17-Dec-03
Reader Level:
In this first part of a two-part article, we are going to be looking at Data Insertion using a simple form that we will create in Macromedia Dreamweaver MX 2004.
Inserting data from a form into a database is something we all have done at least once. For instance, signing up to get email alerts from CNN is a great example of inserting data into a database. Or filling out a form on a website to start a magazine subscription. However, the uses don't stop there. In fact, they are limitless.
Installing Apache/ MySQL/PHP on Windows - Part 2
by Paul Newman - 10-Dec-03
Reader Level:
In Part 1 of this tutorial, we installed Apache, MySQL, and PHP on Windows. In Part 2, we secure MySQL by setting default passwords and configure Apache to run as a service.
PHP User Authentication in Macromedia Dreamweaver MX 2004 - Part Two
by Justin Kozuch - 05-Dec-03
Reader Level:
The User Authentication behaviour built into Dreamweaver MX 2004 can help do things like password protect sections of your site, such as an administration panel, or other things that you want only specific users to see. As such, the User Authentication behaviour is a great tool for accomplishing this, and today, we are going to cover what makes this behaviour "tick" by taking a quick look at the underlying code.
Installing Apache/ MySQL/PHP on Windows - Part 1
by Paul Newman - 03-Dec-03
Reader Level:
Have you been thinking about learning PHP or MySQL? Perhaps you've been curious about AMFPHP, the open-source Flash Remoting solution for PHP. In this tutorial, you'll learn an easy way to install Apache, MySQL, and PHP on the Windows platform.
User Authentication in Macromedia Dreamweaver MX 2004
by Justin Kozuch - 21-Nov-03
Reader Level:
The User Authentication server behavior built into Dreamweaver MX 2004 can help you password protect sections of your site, such as an administration panel, or other areas that you want only specific users to have access to. As such, the User Authentication server behavior is a great tool for accomplishing this. In Part 1 we will go over setting up the User Authentication login form. In Part 2, we'll take an in depth look at the code produced when we use this behavior in a PHP page, and explain how everything works.
The New Dreamweaver MX 2004 Application Group
by Justin Kozuch - 13-Nov-03
Reader Level:
In this article we will look at the new Application group from the currently available Macromedia Dreamweaver MX 2004. The Application group, and its related panels, contain everything you need to start building a database-driven website. Its user friendly interface will make short, and easy, work of working with databases.
Dynamic Letter Anchors extension
by Tom Muck - 02-May-03
Reader Level:
Frequently on a dynamic page that displays a long list of content, such as a list of names, you want to allow a user to jump down to a specific letter of the alphabet. On a static list, this is easy -- just insert anchor links at key places on your page where the first letter of a word changes. On a dynamic page, it is not as easy. Using this extension, you can create a list of links for your data AND create the dynamic anchors to go along with them.
Delivering Browser Specific Styles with PHP
by Tim Green - 30-Mar-03
Reader Level:
As an agreed and recognized standard Cascading Style Sheets are an everyday part of a web developer's life. However, many developers still rely on the use of either browser trickery or client-side JavaScript to send the right stylesheet information to the right browser. While this will quite often work, newer browsers, and the ability to disable client-side Javascript means that you run the very serious risk of sending the wrong stylesheet, or even worse, no stylesheet at all.
In this article we explore the use of server-side PHP code in determining which stylesheet should be presented to which browser, and all before your visitor receives anything from your website.



