PhpRiot
Articles tagged PHP
Displaying articles 41 to 59 of 59

Creating Sortable Lists With PHP And Ajax

You might have been in a situation before where you had a list of items in your database that needed to be output in a specific order. These items could be anything: perhaps a listing of your favourite movies or your favourite books. For whatever reason, you want them ordered in a custom way that can't be determined automatically (such as alphabetical). This article covers the implementation of a system that lets you easily define the order of such a list.

Creating Multi-Step Forms And Wizards In PHP

There will be many situations when creating web forms, that either you cannot accept all data on one page, either because certain responses result in a different set of subsequent questions, or because you form is so long that you need to split it up into multiple pages. The case could even be that you have a 1 page form, but you want to show confirmation of the form data prior to processing the data (e.g. showing a user their order before processing their credit card). This tutorial covers how to implement such forms using PHP. This will include covering the various issues that need to be taken into consideration, as well as a class to help build such forms. Finally, there will be real-world example of implementing a multi-page form using the class.

Other Uses For Smarty

Many people think of the Smarty Template Engine as a system for separating presentation from application logic. This is indeed true, but many people also only consider Smarty for outputting their web site HTML/XHTML. This brief article goes over other situations where Smarty may be useful in your PHP application.

Managing Your Data With DatabaseObject

DatabaseObject is a class I wrote three or four years ago, as a way of easily manipulating database data. It is not a replacement for a database abstraction class. In fact, it works very nicely with a database abstraction class, however, the version we have provided uses the native PHP PostgreSQL and MySQL database calls.

Anti-Spam Techniques In PHP, Part 2

This short series of articles provides a few simple techniques for protecting yourself and your web site from spammers. It does this from two perspectives: 1. Protecting people (including yourself) who post to your web site from being spammed 2. Protecting your web site from being spammed (for example, blog spam) This is the second article in the series, and covers the issue of protecting your web site from spammers.

Cloning Google Suggest With Ajaxac

This article covers how to implement a system such as Google Suggest using JavaScript, CSS and PHP. To aid us in this process we will be using AjaxAC, an open-source framework written in PHP used to develop AJAX style applications. We will be implementing a clone of this application, from start to finish. This begins with setting up our frontend HTML file and CSS styles, creating our AjaxAC GoogleSuggestCloneJax application, and then linking it all together.

Searching Google With The Google API

This article covers performing search queries on Google using their API. This means you can transparently run a Google search in the background, and then present the results to your users however you want to. The Google API is a SOAP web service. SOAP (Simple Object Access Protocol) is an XML schema used for calling a remote procedures (usually) over the web. In this case, the remote procedure is Google search. In this article, we are going to create a single PHP script called google.php, to simply demonstrate how to query Google. Hopefully using this information, you will be able to come up with more advanced ways of using the API.

Storing Images In MySQL

This article is an introduction to using the blob column type in MySQL. The concept is introduced by familiarising users with uploading and storing images in a MySQL table.

An Introduction To PHP Sessions

This article is an introduction to using sessions in PHP.

Anti-Spam Techniques In PHP, Part 1

This short series of articles provides a few simple techniques for protecting yourself and your web site from spammers. It does this from two perspectives: 1. Protecting people (including yourself) who post to your web site from being spammed 2. Protecting your web site from being spammed (for example, blog spam)

Implementing An N-Level Nested Tree In PHP And PostgreSQL Appendix

Since creating the second part of the Nested Tree series, I've done further work on the nested tree class. This appendix article is not officially part of the "3 part series", but it is an addon article which may be continually updated with new ideas and snippets to include in the Nested Tree class. The reason these have been kept separate is because they are not core to the concept of implementing nested trees in your web site.

Implementing An N-Level Nested Tree In PHP And PostgreSQL, Part 2

This series of articles is about implementing a nested tree using PHP and PostgreSQL. This article - part 2 - covers the implementation of managing nested trees in PHP. The data we learned how to store in SQL in part 1 must be extracted somehow. In this article, we will create a class used to extract data from the tree and to rebuild the tree. Each portion of the class will be developed separately, then all combined into a single class.

Advanced Documentation With Reflection In PHP 5

In PHP there are many ways to document code. In PHP the most common method is phpdoc and it is widely used all over. However, with the introduction of Reflection in PHP 5, you no longer need source code scanning tools to generate documentation. This article covers one way to extend and modify phpdoc comment syntax and access the data via Reflection and convert it to machine readable XML.

Advanced OOP With SPL In PHP 5

This article covers the extensions to PHP5's OOP including SPL (Standard PHP Library) and how to use them in a real world setting. For the purposes of this article it will be assumed that you already know about classes, interfaces, static members, and references. You should also understand some basic design patterns like Factory. These concepts will be illustrated through the use of a conceptual database layer.

Debugging Your Web Application

This article covers the implementation of a debugging system in your web site or web application. The system is designed to allow debugging of different aspects of your system at any particular time (e.g. SQL queries, filesystem operations, etc..) and writing the debug messages to a log file.

Protecting Content And Handling Robots

This article discusses ways for site owners to protect their content, handle search robots, prevent unauthorized user activity and to save bandwidth.

Implementing A Breadcrumbs System On Your Site

This article briefly covers implementing a breadcrumbs / trail system. An example of this in action is on this web site (see above where it says "You are here".

Implementing An N-Level Nested Tree In PHP And PostgreSQL, Part 1

This series of articles is about implementing a nested tree using PHP and PostgreSQL. The theory and code in these articles also applies to MySQL, not just PostgreSQL. An N-Level nested tree is a way to represent hierarchical data, such as a list of directories and files in your operating system, or the listings in a directory such as the Open Directory Project. There can be any number of levels and any number of elements within each level. The goal is to be able lookup data in the tree as quickly as possible with minimal strain on resources. We will implementing this using the nested tree model by Joe Celko.

Migrating From MySQL To PostgreSQL In PHP

This article is aimed primarily at MySQL users, showing them how to start with the PostgreSQL database management system. The article covers just a small number of areas, directly related to use in PHP - it barely even touches on most of PostgreSQL's other features.