730 PHP Tutorials. Page 9More than 730 titles from different sources. Prepared by gotAPI.com |
|
|
1 - 75 76 - 150 151 - 225 226 - 300 301 - 375 376 - 450 451 - 525 526 - 600 601 - 675 676 - 750 www.gotAPI.com |
The Iterator Pattern, concluded
This article, the second of two parts, explains how to use the Iterator pattern to manipulate any collection of objects. It is excerpted from chapter eight of the book
The Object Oriented Improvements of PHP 5
While PHP 4 was the first version to offer Object-Oriented Programming (OOP) capabilities, many considered the feature to be poorly designed and more an afterthought than anything else. PHP 5 resolves many of the version 4 OOP inconsistencies, not to mention greatly enhances the language s object-oriented capabilities. While you re still free to program using a procedural methodology, those of you with object oriented backgrounds will certainly f...
The PHP Configuration File
One of the most powerful features of PHP is the ability to customize its behavior through a configuration file. In this first article, we re going to cover some of the ways the php.ini file can be used and how it might help you. The second article will outline in detail many of the more frequently used directives of the php.ini file. // ); //]] Using the PHP configuration file can make administration of PHP as simple as administration of Apache!...
The PHP Scripting Language
This article describes the basics of the PHP scripting language, which is very easy to learn if you are familiar with any programming language. It is excerpted from chapter two of the book
The Power of CVS
It s pretty clear that CVS has become the standard for code versioning and control in the open source community. The core PHP developers even use it to control who can check in code, and to see what changes occurred and who made those changes. CVS isn t just for hardcore software developers. I m finding that it is really useful for developing PHP web sites (or really any HTML site). Since I have multiple machines in multiple locations across the...
The Practicality of OO PHP
There seems to be a common pitfall among some PHP developers--especially those just beginning PHP programming--and that is their lack of object-oriented (OO) PHP use. This article s purpose is to inform developers about the practicality of OO PHP; fully understanding the benefits of using OO PHP should be a requirement in the PHP learning process. Pitfall Among Developers I myself experienced the pitfall in the beginning of my PHP enlightenment, ...
The Singleton and Factory Patterns in PHP: a rendering-capable factory class
In this third part of the series, I will explain how to implement the Factory pattern in conjunction with the polymorphic characteristics of form objects. This will boost the functionality of the factory class by simplifying the process for rendering form elements.
The Singleton and Factory Patterns in PHP: Building a Form Generator Class
In this final part of the series, Alejandro Gervasio examines a point that he has not taking into consideration so far: that the layout of form elements plays a relevant role within the overall development process. With this in mind, he encapsulates the logic needed to generate web forms by defining a form generator class. This class will implement the form element factory along with all of the required form element classes.
The Singleton and Factory Patterns in PHP: Building object-oriented forms
Experienced PHP programmers know that web development problems are often tackled by using widely known design patterns within the context of an application. This article is the first in a series that will demonstrate how the Singleton and Factory patterns can be implemented in a real-world application.
The Singleton and Factory Patterns in PHP: Working With Singletons
In this fourth part of the series covering the Singleton and Factory Design Patterns in PHP, we will discuss issues stemming from the fact that PHP 4 does not have an abstract class. Since we found it useful in the previous article to define the form element factory class as an abstract class, in this article we will discuss the process for making the form element factory class a Singleton, and how this serves our purposes.
The Soothingly Seamless Setup of Apache, SSL, MySQL, and PHP
Our objective is to install a web server that will allow us to host sites, that would be secure for e-commerce solutions, and that could be driven via scripts to connect to a database server and extract its data.
The Standard PHP Library, Part 1
While most of the excitement surrounding the release of PHP 5 focused on its XML and object-oriented features, the Standard PHP Library (SPL) also saw some significant improvements that went mostly unnoticed. In the first of two articles covering the SPL, David Fells discusses the Exception class, which lets programs handle errors more gracefully and simplifies debugging.
The Standard PHP Library, Part 2
In our second article on the standard PHP library, David Fells explains the new Arrray object, introduces Iterators and the ArrayIterator, and discusses some practical examples of their usage. This article assumes a knowledge of how Exceptions work in PHP 5.
The web of services: using XML_RPC from PHP
There re a lot of comments in the market about The web of services from the simple ways of content syndication used today to the futuristic approach of UDDI. In its creation, the web was a collection of documents, browseable information. As the web evolved it was good to add some services to the web. In the future, the web will be the place where organizations provide services useful to the consumer and/or other organizations. This s...
Three-Tier Development with PHP 5
This article will demonstrate the power of three-tier development in PHP 5, using PEAR::DB_DataObject for the business logic and Smarty for display logic. I assume that you have some familiarity with HTML, Smarty, PEAR::DB_DataObject, MySQL, and PHP 5. If you d like to brush up on your knowledge, the following articles explain some of the theory: // ); //]] a
Time is Money (part 1)
So there we all are, the Boss, the Customer, a couple of the Customer s minions and yours truly, all seated around a long table in the Customer s high-tech conference room. The Customer is talking around an evil-smelling cigar and waving his hands around energetically, the Boss is listening patiently, and the minions are grinning idiotically at each other. I have long since tuned out of the conversation, and am currently attempting to figure out ...
Timing Script Execution
No doubt you ve all seen on Google s search page where it tells you how long your search took to complete. This, and some talk I noticed a while back in one of the forums about some of the scripts that were taking a while to execute made me think about how you would go about timing your scripts. The easiest way of timing a script would be to get the time at the beginning of the script and then get the time at the end of the script. The differenc...
Tracking Website Statistics with PHP
If you have a website, especially one that sells products or services, it can be useful to track the visitors to your site. This article explains how to write a program that will do just that.
Transforming XML with XSL using Sablotron
In my last article I covered the use of the expat functions available to PHP for parsing XML documents using the SAX method. The sample code was a class that read the XML document and generated the HTML to present the data in a nice table. This example was far from perfect due to the fact that the presentation of the data was not separate from the class code that had to parse the XML document. This meant that a slight modification to the HTML ge...
Trip Mapping with PHP
Remember Raiders of the Lost Ark? One of the distinctive images was a thick red line cruising across a map, showing Indiana Jones routes when crisscrossing the globe and fighting bad guys. I don t think they used PHP for any of the special effects in 1981, but you can use PHP today to create a similar map of the United States. To draw lines in the right places, you need a few things: data describing the location of U.S. places, a blank map imag...
Two PHP s are Better Than One How to Setup Multiple PHP Builds on The Same Server
So I m sitting there, one warm afternoon, thinking up ways to improve upon the software I ve been developing over the last year or so. Of course, speed improvements are always sought after, as well as improved simplicity of design. When those go hand in hand, you are golden. With PHP it is possible to accomplish both in many ways. One method I have used to great success is to createC modules to expand the core functionality of PHP. Convert a coup...
Understanding MVC in PHP
This article series (continued in Implementing MVC in PHP: The Controller, Implementing MVC in PHP: The View, and Implementing MVC in PHP: The Model) demonstrates how to build an MVC web framework using PHP 5. This article covers the basics of MVC web frameworks, building the foundation classes for a framework that the other three articles in this series will build. With the introduction of PHP 5 and its new OOP features developers can now seriou...
Unit Testing
Having a formalized unit testing infrastructure for your projects will save you time in the long run, especially when looking for bugs in code. This article introduces you to setting up a unit testing framework. It is excerpted from chapter 6 of the book
Unit Testing in Detail
Last week, we introduced you to setting up a unit testing framework. This week, you will learn about running multiple tests simultaneously, creating more informative error messages, and more. This article, the second of three parts, is excerpted from chapter 6 of the book
Uploading, Saving and Downloading Binary Data in a MySQL Database
This article is aimed at answering one of the most asked questions on the PHP mailing list and discussion forums alike: How to store binary files in a MySQL database. // ); //]] I ran into this same question when asked by a possible employer testing my programming skills to create a set of scripts to upload files to a MySQL database, download files from it, and also show an image, if the file was indeed an image. Anyway, I couldn t find any arti...
Uploading Files and Navigating Directories in PHP
In this article we are going to look at how to upload files and also how to navigate through directories. It is the second part of a tutorial that began last week with Reading, Writing, and Creating Files in PHP.
Uploading Files within a PHP Script
Being able to accept uploads from your users is one of those surprisingly essential functions that re-occur in many applications. Examples are everywhere: on bulletin boards people are often allowed to upload attachments and custom avatars, content management systems allow administrators to upload images for posts and web site management scripts utilize uploads to give users to ability to edit and add new files. Adding file uploads to your own sc...
User Authentication With Apache And PHP
A long, long time ago, during my early days with Web application development, I was asked to write an administration module for a Web site. This module was to be available only to site administrators, and so required user authentication, or login, at the entry point itself. I didn t know much about Web development at the time, but I did my best and handed the code over to the QA people for testing.
User Authentication with patUser (part 1)
Over the past couple of years, Web application development has matured to a point where building a Web application is not quite as random a process as it once was. Most developers are now familiar with what goes into building the fundamental skeleton of a Web application: a database to store content, page templates to simplify maintenance, sessions and cookies for temporary data storage, and an authentication and privilege system to manage users ...
User Authentication With patUser (part 2)
In the first part of this article, I focused almost entirely on how patUser could simplify the task of adding authentication to your site. I explained the patUser database schema, ran you through the process of initializing a patUser object instance and linking it to a database and template engine, and showed you how built-in patUser methods could simplify the task of verifying user credentials and writing login and logout scripts.
User Authentication With patUser (part 3)
In the previous segment of this article, I discussed the various library functions related to user and group management, and also showed you some examples of how they could be used in real-world Web application development.
User-defined Interfaces in PHP 5: Building a Page Generator
In this final part of the series on user-defined interfaces in PHP 5, Alejandro puts all of the classes created in the previous articles together to work as a page generator. This allows complex page generation to be translated into a more flexible process through an object-based solution.
User-defined interfaces in PHP 5: Implementing (X)HTML Widgets
In this second part of the series, you will learn the basics of object-oriented web page generation through the use of (X)HTML widgets. You will also see how objects implement the HTMLRenderer interface to explicitly define its functionality by using the toHTML() method.
User-defined Interfaces in PHP 5: Introduction to Core Concepts
PHP5 takes users increasingly in the direction of object-oriented programming. The Standard PHP Library (SPL) is a new item that helps developers both with the creation of OOP applications and the maintenance of standardization. The SPL enables developers to work with user-defined interfaces. In this article, the first of a series, Alejandro Gervasio uses examples to introduce you to working with these interfaces, which can keep you from having t...
User-defined Interfaces in PHP 5: Turning MySQL Classes into Interface Implementers
Welcome to the third part of the series User-defined interfaces in PHP5. In four parts, this series explains the use of interfaces in PHP5, highlighting their advantages and illustrating their implementation in real applications.
User-Friendly Form Validation with PHP and CSS
One of the more common problems PHP programmers must tackle is that of form data validation. For example, suppose you have a form where users must enter an email address. Using a regular expression, you could test whether the format of the email address is valid before using the email address; if the email address doesn t have a valid format, you can ask the user to re-enter it. Unfortunately, many people code their form tags so that the tag s ac...
User Management in a PHP Invoicing System
In this fourth and final article covering the creation of a PHP invoicing system, we re going to put together the user management section. In this section we will be able to view all available users and do all the associated things like deleting or updating user details. We are also going to be able to add new users.
User route tracing
Logging is an old subject. It s simple just record the page requested, time, IP number and maybe the refering URL. Instantly you can draw up graphs on the most popular pages, the best referers etc. This in its own right is very useful. However, when I was looking at the logs on one of my larger sites, I thought - I know that page x gets so many hits a day, but the user could have come to that page using a variety of different routes. How do us...
Using .NET Assembly (Interoperability with COM) in PHP
The .NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. The .NET Framework is designed to provide a consistent object-oriented programming environment, a code-execution environment that minimizes software deployment and versioning conflicts, which guarantees safe execution of code and to build all communication on industry standards to ensure that code based on...
Using Abstract Factory Classes in PHP 5 to Work with Online Forms
Any PHP developer who has worked with pattern-based programming in PHP for a while knows that the abstract factory pattern is useful for building classes that return (to client code) objects whose type depend on the content where they re used. Welcome to the final installment of the series Using abstract factory classes in PHP 5. If you re interested in learning the key concepts of this helpful pattern, this three-part series will tea...
Using Advanced Functions to Maintain the State of Applications with PHP Sessions
Here we are again. This is part two of the series Maintaining the state of applications with PHP sessions. In three parts, this series ranges from the basics of session management in PHP, such as creating, registering session data, and destroying sessions, to exploring advanced concepts, like working with different session storage modules and creating custom session handling objects.
Using Ajax with PHP to Create an Interactive Web Page
Ajax, which stands for Asynchronous JavaScript and XML, is the newest term for a technology that is catching on in popularity. The technology, introduced in 1999, allows a web page, via JavaScript, to make a request back to the server, receive data, and process it without the page ever having to reload. This technique allows for web pages that have automatically updating parts to them or buttons that automatically save data without ever having t...
Using Amazon Web Services With PHP And SOAP (part 1)
Everyone, but everyone, knows what Amazon.com is - it s the largest (and, for my money, coolest) online store on the planet, selling everything from baby clothes to the new Volkswagen Beetle. It s been around since the beginning of the Web and offers one of the friendliest shopping experiences online, together with great customer service and a wide variety of discounts.
Using Amazon Web Services With PHP And SOAP (part 2)
In this concluding article, find out how to add search features to your AWS-backed online store, and link your product pages up to Amazon.com s shopping carts and wish lists. In the first part of this article, I introduced you to Amazon Web Services (AWS), the XML-based API that allows regular Joes to supercharge their online stores with Amazon s product catalog and databases. I showed you the basics of AWS, demonstrating the API calls needed to ...
Using a Template Processor Class in PHP 5
Welcome to part two of the series Separating logic from presentation. Comprised of three articles, this series walks you through the development of an extensible template processor in PHP 5, which you might find quite useful for separating the logic of your PHP applications from their visual presentation.
Using cURL with PHP
cURL is one of the most powerful PHP extensions. It stands for Client URL, and allows you to communicate with other servers using a wide range of protocols. Perhaps that sounds fairly uninteresting, but give it some more thought. Other servers and other protocols? At some stage in a novice developer s career, there comes a time to break out of the local server, and cURL is the first thing you should consider. I first used cURL for quite a simple...
Using cURL with PHP
cURL is one of the most powerful PHP extensions. It stands for Client URL, and allows you to communicate with other servers using a wide range of protocols. Perhaps that sounds fairly uninteresting, but give it some more thought. Other servers and other protocols? At some stage in a novice developer s career, there comes a time to break out of the local server, and cURL is the first thing you should consider. I first used cURL for quite a simple...
Using Directory Iterators and MySQL with Adapter Objects with PHP
If you re a PHP programmer who s searching for a comprehensive tutorial on how to create adapter classes with PHP 5, them look no further. Welcome to the final installment of the series Implementing adapter objects with PHP. Made up of two parts, this series teaches you how to implement the adapter design pattern in PHP 5, and it accompanies the corresponding theory with educational examples.
Using HTTP Compression in PHP: Make Your Web Pages Load Faster
Web developers are always looking for ways to reduce the loading time of their pages. This article, the first of three parts, shows you how to make PHP pages load faster by showing you how to compress dynamic PHP pages. Techniques covered include using PHP s built-in gzencode() function, along with output buffering control functions.
Using Inheritance, Polymorphism and Serialization with PHP Classes
If you are working with classes in PHP, you will sooner or later encounter inheritance, polymorphism, and serialization. The ability to use these three will help speed up your code writing. This article covers how to use them, and more.
Using Introspective Methods with the DirectoryIterator Class in PHP 5
If you re one of those PHP developers who want to explore the package of classes that come bundled with the Standard PHP Library (SPL), then fear not, because you re at the right place. Welcome to the concluding part of the series A Close Look at the DirectoryIterator Class in PHP 5. In three parts, this series introduces the most important methods attached to this class, and shows you how to use them by mean of extensive hands-on examples.
Using JavaScript To Call PHP Database Routines Between Windows
In an effort to bring high ease of use, some of us provide a HTML styled select or drop-down list of selections the user can make. It s not too hard to have PHP build a variable that holds a select option list such as: ?php$OptionList = ; $First = 1;while ($Row = mysql_fetch_array($Result, MYSQL_ASSOC)) { $ContactID = $Row[ContactID]; $Company = $Row[Company];br
Using Method Call Overloading in PHP 4
This is part two of the series Overloading classes in PHP. In three tutorials, this series teaches how to overload your classes in PHP 4 by using the overload() PHP built-in function, in conjunction with the implementation of the __set() , __get() and __call() methods, and explores the native support of object overloading in PHP 5.
Using MySQL s Built-In Replication To Maximize Availability
Here at Soundbreak we stream out live audio and video 24 hours a day, so it didn t take much convincing to be able to run some testing on MySQL s new replication feature. We discoverd that we could use it to keep an up to date standby database server that could handle all of the queries should the primary fail for any reason. It s not dificult to configure two servers for just such a purpose, and I ll walk through the procedure, as well as a dis...
Using PEAR s HTML_Table Class
Within the current incarnation of (X)HTML tables are the building blocks to well organized and attractive designs. They allow the developer an incredible amount of control over the visual representation of information and graphics. However they come with a catch, they are an absolute headache to write into your PHP code. The simple process of querying a database and showing the results in a table becomes a disorganized and ungainly process looki...
Using PHP 5 s SimpleXML
XML is great, but I ve constantly wondered why it s so difficult to parse. Most languages provide you with three options: SAX, DOM, and XSLT. Each has its own problems: // ); //]] SAX s event-based design forces you to track elements manually, by pushing and popping them on and off of a stack. DOM is bulky and cumbersome. While comprehensive, it takes seven lines just to read hello. XSLT? If I wanted to program in a functional language,...
Using PHP and MySQL with Flash
This article helps explain how to use Macromedia Flash 5 in conjunction with PHP and a MySQL database. This demonstration will show you how to setup a simple login and registration form, then allow users to save movie clip positions and various properties in the database. When they log back in the movie clips are in the same position. For this tutorial you will have to have some basic knowledge of PHP and MySQL, hopefully you won t need much tho...
Using PHP and XML with Apache Cocoon
First off, for those of you who don t know what Cocoon is, check out http://xml.apache.org where you can download the source and read up on it. In short Cocoon is a suite of Java Servlets that sit on your server waiting for .xml pages and then - if applicable - it applies the relevant XSL transformations. With one XML page and different XSL pages you can deliver rendered output suitable for your Browser, for example HTML for your Desktop or WML ...
Using PHP As A Shell Scripting Language
As most of us already know, PHP is the best language for developing dynamic web pages available today. Not many people are aware that it can be used as a shell scripting language as well. While PHP as a shell script isn t as robust as Bash or Perl it does have definite advantages, especially if you re like me and are more proficient in PHP than you are in Perl. The requirements for using PHP as a shell language is that you must compile PHP as a ...
Using PHP Error Handling
An all to common error on the web is broken links. You end up with broken links from other sites whenever you rearrange your site. People bookmark some page they like and come back 3 months later only to find a 404 Not Found , giving them no help whatsoever about where to start looking for the page you originally had on your site. Let s solve this, or atleast be friendly to your users and help them get back on track whenever they hit a 404 . Y...
Using PHP for RTF
Recently, I had a brief stint with RTF (Rich Text Format) files. I had to write an RTF file and send an RTF file as attachment in mail. Initially it was a pain to understand the RTF file format. Its header part was apparently the most confusing part. But when I had some understanding of the header, the remaining task was not that difficult. Here, I am not going to provide you with codes for writing an RTF, but I ll help you understand how this c...
Using PHP Operators
Operators are one of the most essential components of PHP; in fact, there is little you can do without them. They are used to assign variables, work with strings, and work with numbers. They are also integral in controlling program flow, as you will later learn. In this article, we will be exploring some of the most common operators used in PHP, and how to use them. So what exactly are operators? Well, to briefly define them, an operator is any ...
Using PHP to Interpret Forms
The Internet, as we know it today, is primarily the result of two seminal events: // ); //]] The February 1993 introduction of Mosaic, the first graphical Web browser (see references in the sidebar to the right), and, The 1994 addition of forms to the HTML specification. Mosaic, with its multimedia capability, added entertainment value to what had previously been a bland character-based medium. Forms created the capability for dynamic Web sites ...
Using PHP to Make Basic vCalendar/iCalendar Events
by: Shu-wai Chow If you maintain a web calendar, the vCalendar/iCalendar specifications can help you share calendar events with users through your site. By clicking on a simple link to a text file, your events can be added to your users Outlook, Palm Desktop, or scheduling program of their choice. Such an application can be easy, simple, and automated if the event data is stored in a database, and the text file is formatted to the vCalendar/iCal...
Using PHP with Files
The ability to work within the file system is the power to store and retrieve information from the server. Combined with forms, it s the basis for a range of applications like guestbooks, blogs, images galleries and more. In the next two articles, you will get an in depth look at how to work with files and directories. You will learn how to use text files as databases, perform basic tasks such as renaming and deleting files, and manipulate direct...
Using PHP with Forms
Once you know the basics of PHP s syntax and structure, it is fairly easy to make the leap to writing full-fledged scripts. Because working with forms is one the most common tasks in writing applications for the web, the first script we write will be a form processor. Though a fairly mundane application, it will introduce you to a range of important concepts, including how PHP handles variables that come from outside the running script. First, le...
Using PHP with Java
One of the coolest things about PHP has to be the wide range of extensions available for the language. Having problems communicating with a particular database? PHP has a wide range of extensions for different databases. Want to process credit cards transactions? PHP includes an extension that allows you to integrate CyberMUT on your Web site. Want to parse and transform XML documents? PHP comes with a built-in SAX parser and XSLT engine.
Using PHP With LDAP (part 1)
One of the reasons for PHP s immense popularity is its support for a wide variety of different Internet technologies. It is this support, coupled with the speed with which new language extensions get added to the source tree, that keeps PHP ahead of other competing languages in the same category, and ensures the continuity (and future growth) of the fan following it currently enjoys.
Using PHP With LDAP (part 2)
In the first part of this article, I gave you a crash course in the basics of using PHP with LDAP, demonstrating how PHP s built-in support for LDAP makes it easy to query an LDAP directory server for user information. That article also included a detailed discussion of the steps that make up a PHP-to-LDAP session, together with examples demonstrating how those steps play out in the real world.
Using Recursive Methods in Object-based PHP Applications
Welcome to the second tutorial of the series Recursion in PHP. Comprised of three parts, this series introduces the fundamentals of recursion in PHP, including the definition and use of recursive functions in procedural PHP scripts, as well as the creation of recursive methods in object-oriented Web applications.
Using Self-Saving Objects with Command Objects in PHP 5
If you were looking for an approachable guide on how to create and use command objects with PHP 5, then look no further, because your search is over. Welcome to the final part of the series Creating command objects with PHP 5. Comprised of three comprehensive tutorials, this series walks you through the basics of how to apply the command pattern in PHP, and it accompanies its corresponding theory with numerous code samples.
Using Session Handling Objects to Maintain the State of Applications with PHP Sessions
Here you have it. The tutorial that you were waiting for! Welcome to the concluding part of the series Maintaining the state of applications with PHP sessions. In several tutorials, this series goes through the key points of managing sessions in PHP, and explores some of their most advanced features, such as developing user-defined session storage modules and using session handling objects.
|