730 PHP Tutorials. Page 10More 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 |
Using Shared Memory from PHP
IPC is one of the most important features of the UNIX systems. It allows two processes to communicate with each other. In this article we ll work with two System V IPC functions, semaphores and shared memory. System V IPC originated in SVR2, but has implementations by numerous vendors. It s also available in SVR4. // ); //]] IPC is a complex concept. The term includes various mechanisms of data exchange between processes started on one system. I...
Using The Google Web APIs With PHP
Unless you ve been living in a cave for the past couple of years, you already know what Google is. In fact, if you re anything like most Webheads, you ve probably used it in the last sixty minutes. With its unique indexing technology and huge database of Web pages, Google has rapidly become the best search engine on the Web, bar none - and the company s constant innovation promises to keep them ahead of the pack for a while longer.
Using the Manual at PHP.net
It might seem ridiculous to write about something as simple as how to use the online manual at PHP.net, but for two reasons I believe it s not really so absurd. When I first wandered into PHP territory I tried to use the manual . While being the most comprehensive resource available I was unable to deal with it. I could not find the help I needed nor was I able to understand much of what it was telling me. I asked a friend to provide me with a ...
Using the Memento Pattern with a File Reading Class
The memento pattern can be used to maintain the state of a property that belongs to a specific class. If you want to learn more about how to do this, start reading this tutorial! Welcome to the final installment of the series Maintaining the State of Classes. In two parts, this series teaches you how to use the memento design pattern with PHP 5, and it accompanies the corresponding theoretical concepts with diverse hands-on examples.
Using the mysqli Interface: Basic Techniques
This article will illustrate some basic techniques for using the mysqli interface. This is a great tool to use in php5 because it doesn t need any include libraries like PEAR, etc; it is compiled right into the distribution. In fact, to start using mysqli methods right away all you have to do is call the object with the right initialization parameters: $dblink = new mysqli($dbLoc, $dbUser, $dbPw, $db) or die(mysqli_error($dblink)); I put the ext...
Using the PHP Crypt Function
The PHP crypt function is a one-way encryption function that lets you confirm that an entered password matches a stored encrypted one -- without having to decrypt anything. Chris Root explains how it works.
Using the Sleep and Wakeup Functions to Serialize Objects in PHP
Curious about how to serialize your objects inside your beautifully-crafted application? Look no further. Welcome to the second part of the series Serializing objects in PHP. This set of three tutorials introduces the fundamentals of objects serialization, and teaches you some advanced concepts regarding this approach, such as using objects in sessions and storing them in database tables.
Using Unbuffered Queries and More with SQLite with PHP 5
Are you one of those PHP developers looking for a tight and powerful RDBMS, other than MySQL, in order to build your next database-driven website? Then hopefully your search is finished. Welcome to the second installment of the series Using SQLite with PHP 5. Comprised of three articles, this series walks you through the implementation of the most important methods that come bundled with SQLite and shows you how to use them with numerous practi...
Using Variable Variables in PHP
Quite possibly one of PHP s least utilized yet most valuable features is its support for Variable Variables. I stumbled across this concept just recently while working on a Fiction Portal project for a gaming website. Users of the service could submit their own fictional stories to a program which would then dump them into a MySQL table and populate that table s columns with the characteristics of the story that the author provided. The way the...
Using Visitor Objects with MySQL Data Sets in PHP 5
If you re looking for brand new material to help you expand your background in using design patterns with PHP 5, then hopefully this article will suit your needs. Welcome to the final installment of the series Introducing Visitor Objects in PHP 5. Composed of three chapters, this series walks you through the key points of creating and using visitor objects with PHP 5, and teaches you how to use them in the context of real-world applications.
Using Webalizer to analyze Apache logs
Every ISP needs a log file analysis program. One of the best is the Webalizer, an open source product originally written in Perl and rewritten in C soon thereafter. It can parse both Common Log Format and Combined Log Format files at a blistering pace. One benchmark states that On a 200Mhz pentium machine, over 10,000 records can be processed in one second, with a 40 Megabyte file taking roughly 15 seconds (over 150,000 records). When one of my ...
Using Windows and Apache to develop PHP3
One of the most commonly asked questions on the PHP3 mailing list is How do I set up PHP on my Windows machine? Well, hopefully, I can help answer this question. When done properly, using Windows to develop PHP3 sites can be very advantageous. This tutorial is meant to show you how to use Apache and Windows for developing. It in no way tries to show how to set up a production web server using Windows and Apache. Installing Apache Fir...
Using XML, Part 5: SOAP and WSDL
In the previous article in this series I demonstrated how XML is used to make remote procedure calls with XML-RPC in PHP. This article will focus on SOAP and WSDL (both of which use XML as their underlaying method of describing data) and demonstrate how a PHP script can act as a SOAP client and auto-magically discover detailed information about a web service. An overview of Soap SOAP, originally an acronym for Simple Object Access Protocol, is a ...
Using XML: A PHP Developer s Primer
This series of articles will focus on XML, its applications in modern day web development and how PHP fits into this niche. In this article, we will focus specifically on the tools provided to us by PHP which enable us to manipulate XML data sources. What is XML and Why Use it? XML (eXtensible Markup Language) is a W3C standard designed to allow the easy exchange, storage and use of data between web applications and services. Data encoded using t...
Using XML: A PHP Developer s Primer, Part 2
In the first part of this series, we took a look at how PHP 5 can be used to manipulate and parse XML files. In this installment, we are going to focus on Ajax, one of the most useful and topical applications of XML. Initially, we are going to introduce Ajax and learn how to use the XMLHTTP object provided by most modern web browsers to create a live email validation form. Then we will pick up where we left off with the theme of XML and introduce...
Using XML: A PHP Developer s Primer, Part 3
In our last article, we touched the surface of Ajax by developing a simple email validation application. In this article we are going to delve deeper into Ajax and explore how XSL can be used on both the client side (using Javascript) and on the server (using PHP) to transform XML data into XHTML. eXtensible Stylesheet Language (XSL) XSL is an application of XML that is used to describe the presentation of XML through the use of stylesheets. It i...
Using XML: A PHP Developer s Primer, Part 4: XML-RPC, PHP and Javascript
This is the second half of an article that began last week. If you haven t read the first part, please do so before reading on... Creating the PHP Server The PHP RPC server uses the XML_RPC_Server object provided by the PEAR XML-RPC package. Both this and the EmailValidator object will be required in the server: require_once email_validator.php ; require_once XML/RPC/Server.php ; PHP fun...
Using XML: A PHP Developer s Primer, Part 4: XML-RPC, PHP and Javascript
In this article we will demonstrate how PHP can be used to call upon web services provided by third part sites via an XML-RPC server. We will also show you how to create your own XML-RPC and use client-side Javascript to invoke procedures in your PHP scripts. What is RPC? RPC is an acronym for Remote Procedure Call. As the name suggests, RPC is a technology that provides an interface for making procedure calls over a network. Remote procedure cal...
Using XML - Part 6: Validation
This series has so far focused on XML technologies and how they can be utilised using PHP 5. A subject we have not touched upon yet, is XML validation. This article will explore the application independent XML validation standards of DTD s, the XML Schema Language and the XSLT-based Schematron language. I will demonstrate how to validate XML in PHP and demonstrate how PHP 5 s XSL extension can be used to validate XML using the Schematron language...
Validating Emails with PHP
How many times have you heard of email being termed the ultimate killer application? Indeed, the impact that it has made on all of our lives in such a short period of time is immeasurable. After all, email offers a highly effective mode of communication, both in terms of QoS (quality of service) and cost. Furthermore, it s asynchronous nature offers both parties the freedom of participating at a time most convenient to their time schedule. Give...
Validating Incoming Clients for Anonymous Proxy Use
Anyone who has administered or moderated an IRC channel, bulletin board site or similar will recognize the scenario. A troublemaker, whether because what they re posting is abusive, illegal or just simply against the terms of service of the site or server in question is banned and reappears under a new identity and new IP address, courtesy of a proxy that has been left wide open and where the system administrator is, unsurprisingly, reticent in r...
Validating Incoming Data by Using Polymorphism with Objects in PHP 5
If you re a PHP developer who wants to learn how to take advantage of polymorphism to build more efficient and robust object-oriented applications, then this group of articles might be what you need. Welcome to the final part of the series that started with Using Polymorphism with Objects in PHP 5. Comprised of three tutorials, this series shows you how to create polymorphic classes with PHP; it also teaches you how to use them in rea...
Validating PHP User Sessions
Before we start digging into how to manage user sessions, it is important to first understand what sessions are for. In a nutshell, sessions are the way that we maintain state from one page to the next, that is, how we identify specific users across multiple page requests. The ability to track users as they go from one page to the next using sessions allows us a number of options, such as tracking where they are going (web statistics) or to ver...
Validating User Input with the Strategy Pattern
The strategy design pattern is applied much more often than you might think, so if you want to find out how to implement it with PHP 5, this article should guide you through the whole learning process. Welcome to the final installment of the series that began with Introducing the Strategy Pattern. In two parts, this series walks you through the key points of how the strategy pattern works, and accompanies its theoretical concepts with copi...
Value Objects and Data Access Objects with PHP 4.2.x
My real job involves working with J2EE applications at this time. It pays the bills. I ve worked with ASP in the past and have recently (2003) gotten more into working with PHP. Most of my sidework these days is data driven PHP/MySQL web sites. It s unfortunate that sidework doesn t pay the bills, because I have found PHP to be a very powerful programming platform. My attempt here is to apply some principles and concepts that I have learned in m...
Variable Manipulation and Output
This article will conclude our discussion of variables in PHP by presenting the numerous ways that atomic PHP variables can be manipulated and accessed within PHP scripts. We ll also look at the echo command and use it to create our first PHP script that truly outputs dynamic content to the user. // ); //]] Basic manipulations Now that we have a better idea of the types of variables in PHP and are familiar with how to use them, we will begin dis...
Variable Variables, PHP, and You
During a recent project I discovered a totally new concept in programming for myself, variable variables. I needed to update multiple records from one page. After banging my head on the wall for quite some time, I stumbled across the variable variable and all my troubles went away! Introduction So, just what the heck is a variable variable anyway? According to the PHP manual, a variable variable takes the value of a variable and treats that as t...
Visual Verification in PHP
Many topics on the discussion forums deal with the verification of form data. Often it is checked to determine whether or not the submission is from a user or from a bot, if the email address entered is a valid address, or if all the information that is required has been entered into the form. While it s fairly easy to check to see if a form field is empty, determining if the posted information came from a real human is another task altogether...
WAP In Perspective
The purpose of this article is to address the apparently widespread wave of pessimism surrounding WAP technology and of its impending demise! There are many articles currently being pushed from pillar to post around the Internet, about how WAP is about to fall down around our ears and how WAP is no good, people don t like it and it s unreliable! I thought I would take some time out to give a different viewpoint. At this stage, you might well say...
Watching The Web
So there I was, minding my own business, working on a piece of code I had to deliver that evening, when the pretty dark-haired girl who sits in the cubicle behind me popped her head over and asked for my help.
Web App Security Testing with a Custom Proxy Server
In this article, I ll discuss some common web-application security flaws and then demonstrate how to detect them. In the process of auditing web applications for security flaws, I will also present a PHP script that will act as a web proxy server, allowing us to intercept and alter HTTP requests between the web browser and the target web server. As we will see, this PHP script will aid us tremendously in testing for security flaws. Let s start by...
WebBox Architecture in PHP
Almost any interactive website breaks down into logical divisions. For example, there is sometimes a People section of the site where you can create an account for yourself, log in to your account, edit your account, etc; on e-commerce sites there s always an Order section where you create order, check an order s status, cancel an order, update an order, etc. In the webbox architecture each of these functional...
Web Development With PHP FastTemplate
If you ve worked with PHP, JSP, ASP or any other tag-based scripting language, you already know that one of the most powerful features of these languages is the ability to combine regular HTML code with programming constructs like variables and function calls. By substituting variable placeholders for actual content in an HTML page, these languages make it easy to construct dynamic Web pages; simply alter the values of the variables embedded wi...
Web mail in PHP
Asked to write an article about Apache and PHP, I had to take a moment to come up with a good sample application to demonstrate the beauty of Apache and PHP. It had to be something that I would personally like to use but simple enough for educational purposes, and something at least marginally original. A Web-based e-mail interface may not be a very original idea, nor is my humble example any match for the more advanced Web mail applications that...
What s New in PHP 5
The long anticipated PHP 5 release comes with a slew of new features aimed at simplifying development with PHP. With PHP 5 comes the introduction of exception handling, the Standard PHP Library (SPL), enhanced support for XML, reflection, and quite a few enhancements to the object oriented features of the language. PHP 5 also offers a sizable list of new functions, many of which will not be covered in this article but are available in the manual.
What s new in PHP 5 and PHP 6
Most PHP installations out there are still running PHP 4.x. PHP 5.0 has been out a while, and PHP 5.1.1 has just been released. For those of you who haven t yet upgraded, this month I look at some of the changes you can expect to find in the newer versions of PHP, as well as a preview of what you can look forward to in PHP 6. Changes in PHP 5.0 As befits an entirely new version number, there are substantial differences between PHP 4 and PHP 5. M...
Where Did They Go Today? Knowing Where People Go When They Leave Your Site.
Have you ever wondered where people go when they leave your site? With php3 it is easy to trace this. Sure, several solutions of redirect-cgi s exist, but why bother with another language when you can keep it straight to php3 and make it more comfortable? My setting for writing this from scratch was a site where I had multiple pages with identical links in a part of them, but I d wanted to know the use of the external links in detail: Who left w...
Why PHP 5 Rocks!
PHP 5, which was released earlier this week, is the first major release of PHP in years to focus on new features. // ); //]] While one of the key goals behind PHP 3 was increasing PHP/FI 2.0 s performance and efficiency, at the same time it introduced a whole new set of functionality. That was back in 1998. PHP 4 provided another speed burst, as it introduced the Zend Engine. However, the majority of PHP 4 s changes were behind the scenes. Those...
WML Scripting Tips and Integration with PHP
This series of articles describes how to provide Web content to mobile devices through WML (Wireless Markup Language). This article covers some additional uses for WMLScript and how to integrate PHP with WML. Future articles will cover more advanced PHP and WML techniques. Note: These articles cover WML and WMLScript version 1.1, which are supported by the majority of mobile devices in use today. The articles assume a working knowledge of HTML an...
Working with Directory Iterators and Proxy Classes with PHP 5
If you re a strong advocate of using pattern-based programming for developing your PHP applications, then this pair of comprehensive tutorials might find a place on your quick reference list. Welcome to the concluding part of the series Building Proxy Classes with PHP 5. In two parts, this series introduces the foundations of how to apply the proxy pattern with PHP 5, and it accompanies the corresponding theory with extensive code samples.
Working with Files in PHP
Welcome back. In my last column, I finished my discussion of using references in PHP to do some pretty powerful things. This week, I ll be changing gears completely and begin my discussion of working with the file system through the use of an extensive set of PHP functions. I ll cover the fundamentals of reading and writing text files first, then cover some of the more advanced features and offer a few great shortcut functions. Let s get started....
Working with Files in PHP, Part 3
Welcome back. In my last article I introduced how to use PHP to read and write binary files. This week, I ll introduce the concept of working with directories in PHP, including creating new directories, changing directories, and getting a file list for a given directory using PHP s pseudo directory object. We ll be starting from reading directories from a list, and then we ll discuss creating new directories or changing the current directory usi...
Working with Files in PHP, Part Two
Welcome back to PHP Foundations. Last time I introduced you to the basic file access methods available to PHP: fopen(), fputs(), and fgets(). Although very useful, these functions work only with strings. This week I ll introduce to you more advanced file access functions that read and write binary files. We ll talk about fread() (used for reading), fseek() (used to find specific parts of a given file), along with a few other useful file access fu...
Working with Forms in PHP, Part 1
In today s PHP Foundations, I ll begin my introduction of working with HTML forms from PHP. Since there is only time to discuss strictly PHP-related materials, I ll assume that you are already comfortable with HTML and creating HTML forms for user input. If you would like a refresher, there are a number of HTML resources available online. A personal favorite is Sizzling HTML. Getting Form Data Into a PHP Script Assuming that you have already desi...
Working with Forms in PHP, Part 2
Welcome back to PHP Foundations. In my previous column, I explained how to retrieve form data with a PHP script via the superglobal arrays ($_GET, $_POST, and $_REQUEST) and the import_request_variables() function. In today s column, I ll be looking at how to accept HTTP file uploads via PHP in a web page. // ); //]] Before showing any code, it is important that I acknowledge that there are a number of PHP configuration directives that affect th...
Working with Multiple Template Files to Separate Logic from Presentation
Welcome to the last part of the series Separating logic from presentation. In three tutorials, this series teaches you how to develop an expandable template processor class using PHP 5, which exposes some useful features, such as recursive placeholder replacement, MySQL result sets processing, and parsing of dynamic PHP files, among others.
Working with MySQL and Sessions to Serialize Objects in PHP
If you re interested in learning how to combine objects, sessions and MySQL, this is the article that you ve been waiting for. It s the final part of the series Serializing objects in PHP. In three parts, this series goes through the fundamentals of serializing objects in PHP applications, and explores some advanced topics with regard to this subject, including the use of the magic __sleep() and __wakeup() functions, and the manipulation of...
Working with MySQL Result Sets and the Decorator Pattern in PHP
If you re one of those avid PHP developers who wants to learn how to apply the decorator design pattern within your Web applications, then this group of articles might be quite appealing to you. Welcome to the second part of the series Using the Decorator pattern with PHP. Comprised of two parts, this series walks you through the core concepts of using this pattern in PHP, and shows you its practical edge with numerous hands-on examples.
Working with Permissions in PHP, Part 1
In the past few columns, I have been discussing using PHP s file I/O capabilities for manipulating both files and directories. This week, we ll take a slight detour from a strictly PHP-related subject and discuss file permissions in Unix systems. If you are using PHP in a Windows environment (or other environment without a permission system), this column may not apply to you. // ); //]] How Permissions Work Bef
Working with Permissions in PHP, Part 2
In my last column, we took a step away from PHP to discuss the Unix permissions system. In today s column we return to PHP to show you how to apply what you learned last time; again, this column applies only to those who work with PHP in an environment that supports Unix-like permission. // ); //]] A Note on Permissions and PHP Before I begin to discuss t
Working with Strings and the Composite Pattern in PHP 5
Are you a PHP developer who wants to improve your skills in pattern-based programming in PHP? If the answer to this question is an emphatic yes, then you should begin reading this article now! Welcome to the final part of the series Implementing the composite pattern with PHP 5. Comprised of two instructive tutorials, this series walks you through the basic concepts of this important design pattern, and shows you how to apply it with some educa...
Working with Template Classes in PHP 5
A template class is a base class with some special abilities. First, it concretely implements one or more algorithms; second, it can determine which subclasses should use these algorithms. This article is the first part of a two-part series that introduces you to the basic concepts of this design pattern.
Writing Clean and Efficient PHP Code
If you ve ever had to go back to an application you wrote after an extended period of time, you already know the value of clean, well documented and efficient code. But how can you make your code better? Here are some tips that ll help you speed up and clean up your development cycle.
Writing Learning PHP 5
What are the tools and processes that I used to write Learning PHP 5? // ); //]] Each chapter (and appendix) is its own file, formatted with the Docbook Lite XML dialect. I used XEmacs to edit the files. XEmacs s xml-mode provides helpful assistance with well-formedness checking and context-sensitive tag insertion. It also works with XEmacs font-lock mode to make tags, attributes, and other XML goodies appear in pretty colors for easier readabi...
Writing Self-Documenting PHP Code
There are two things that developers hate.
XML and PHP. Part 1: Using The WDDX Functions
I ve had text lying around from when we were writing the book (1) last year, and the people at Wrox gave they OK for the information to be put as articles in PHPBuilder.com, so here it is the first one of a series. Introduction The Extensible Markup Language (XML), is a metalanguage that allows the definition of markup languages. It is not a markup language in itself, but you can think of it as providing the construction rules for specialized la...
XML How-To
Recently, at work I was given the job of learning XML. OK, so it wasn t technically XML, it was RDF, but I found that PHP s XML parsing functions worked just the same. At work I parsed out DMOZ (http://www.dmoz.org) but for simplicity I will stick with the basics of XML and then leave you free to parse DMOZ in your extra time ;o) To begin with you will want to make sure that you have a PHP binary compiled with the --with-xml option enabled. On...
XMLHttpRequest and AJAX for PHP programmers
Although the concept isn t entirely new, XMLHttpRequest technology is implemented on more sites now than ever. Compatibility is no longer an issue (IE, Mozilla and Opera all support it), and the benefits to using it are amazing. There are too many PHP programmers avoiding any work with javascript beyond simple form validation, and for good reason. It s difficult to keep several languages proficiently under your belt. But using the XMLHttpRequest...
XMLHttpRequest and AJAX for PHP programmers, Part 2
This week s article takes off where last week s tutorial left off--we re about to jump into the creation of the PHP backend! If you haven t read the previous article, we recommend that you begin there before moving forward so you don t miss anything. Calling the Functions Now, how is the products.html page supposed to call these functions? We want to be able to let the user select an item, and then load the values based on that selection. Using ...
|