Sites Of Interest: Free Online Application Builder : Build Your Own Chat Room
Click here

/ Home / Tutorials / PHP

PHP

Here you find a selection of tutorials and tips covering covering a wide range of PHP topics.

  • SitePoint.com: Build a Photo Gallery Using CakePHP and Flickr

    Want to share your Flickr photostream with the world, but only once you've given it a nice, customized touch? Look no further than CakePHP -- and a few lines of code -- to pull off some magic! In this article, we'll use the Flickr API and CakePHP to take the images we've loaded onto Flickr and use them to build our own, non-Flickr web gallery.

    Read More

  • The Bakery: How I Built a Web 2.0 Dating Site in 66.5 Hours

    On the Bakery (the CakePHP blog), there's a new case study on how a group of developers created a "Web 2.0 dating site in 66.5 hours" (just short of 3 days worth of work).

    "Let this be a testament to Web 2.0 and the effectiveness of rapid development frameworks: I built a full-featured dating website (http://mingle2.com), from concept to launch, in 66.5 hours. In a typical
    9-5 job this would amount to about a week and a half. Deliverables included: the idea, planning, design, development, testing, and launch. "

    The study is broken up into the (long list of) key steps that were followed:


    • Identify an Opportunity
    • Brain-dump
    • Generate ideas from your competition
    • Brain-dump some more
    • Have a specific goal, don't try to make the website do everything
    • Keep. It. Simple. Stupid
    • Minimize interference
    • Avoid "feature creep"
    • Web 2.0 names are going to be very tacky in a few years
    • If you get stuck on something, put it on the backburner
    • Prioritize features so you can give prominent real estate to those that need it
    • Put a lot of work into the functional mockups
    • Mix it up, keep things interesting


    And finally, "The Design" where he looked at achieving balance, got a "holy crap, that's pretty" reaction, and to make things look up to date. The end result of the labor is mingle2.com, a 100% free online dating website.

    Read More

  • Zend Developer Zone: Ajax Chat Tutorial

    This tutorial is a step by step introduction to creating a lightweight chat application using XML as a storage medium. As personal motivation, I develop PHP games as a hobby. In pursuit of that hobby I've found that offering a flat threadless forum in such games tends to result in heavy usage as players attempt to use it as a chat room. The reason is that even with the advent of irc and instant messengers, users continue see an alternative web based solution as attractive for a number of reasons whether its limited access to instant messengers through a corporate proxy or simply for convenience sake.

    Read More

  • Developer Works: Understanding the Zend Framework

    We programmers are a paradoxically lazy lot. By that, I mean that we will spend hours, even days, creating something that allows us to complete a task in 30 seconds instead of five minutes. So perhaps the creation of the Zend Framework isn't much of a surprise.


    You mean you haven't heard of the Zend Framework? Don't worry -- you will. This article gives you a high-level view of the Zend Framework, explaining its general concepts and preparing you for the rest of this "Understanding the Zend Framework" series, which goes into the details by chronicling the creation of a new online RSS/Atom feed reader. We won't do much coding in this article, but for the rest of the series, you should be familiar with PHP.

    Read More

  • Developer Works: Generate Flash movies on the fly with PHP

    Rich Internet Applications is the new buzz-phrase for Web 2.0, and a key component of the substance behind Web 2.0 is Adobe Flash. Learn how to integrate Flash movies into your application and generate Flash movies dynamically using the Ming library.


    Web 2.0 promises Rich Internet Applications. But what does Rich Internet Applications mean? In general, it means adding highly responsive interactivity to a Web application. Specifically, it means widgets, Web forms, and reports that change on the page instantly without having to retrieve a new page from the server.


    One method for building Rich Internet Applications (RIAs) is to use Dynamic HTML (DHTML), which is a combination of Ajax, JavaScript, Cascading Style Sheets (CSS), and HTML (see Resources). But DHTML isn't the only way of adding interactivity to your Web application. Another big player is the Adobe Flash Player, which has been adding interactivity to Web sites for more than a decade.


    While the first version of Flash was a tool to create animated images, newer versions can host an entire interface that controls Web service access and provides full scripting support using ECMAScript (the official version of JavaScript).

    Read More

  • Build a simple Chatterblock in PHP and Mysql

    This tutorial shows you how to make a ChatterBlock. ChatterBlocks are small windows where users can type in messages. They're also called Shout Boxes or TagBoards and are kind of like miniature chat rooms

    Read More

  • Create a simple hit counter using PHP and MySQL

    n this article I describe how to use PHP and MySQL to produce a simple counter that can be placed on a web page. PHP and MySQL work very well together, and this article shows, hopefully, how easy they are to use to produce a useful little utility.

    Read More

  • DevShed.com: An Introduction to PHP Security

    Since its introduction in 1994 or thereabouts, the PHP language has grown to become the most popular scripting language in the world of server side scripting and now powers most of the web's most visited sites. With this popularity came new concerns such as performance, maintainability, scalability, reliability and (most importantly) security.

    Read More

  • Developer.com: Developing a Ajax-driven Shopping Cart with PHP and Prototype

    On Developer.com, Jason Gilmore has posted This new tutorial that steps you through the creation of an ajax-enabled shopping cart that combines PHP and Prototype.


    In the latest installment of this ongoing PHP series, I'll show you how to build a shopping cart using PHP, session handling, and the Prototype JavaScript library (introduced in an earlier installment). The cart allows users to add and delete products from the cart, as well as change cart quantities. And of course, the interaction is seemingly instantaneous, allowing for the user to continue shopping without waiting for the page to reload.


    He creates the database table first (bottom up approach), then moves to the PHP code to handle the request/responses for the shopping cart, and with a little bit of session magic to connect the cart to the user and the Prototype tossed in, the cart is complete.

    Read More

  • DevShed: Creating an RSS Reader: the Reader

    In a new tutorial from DevShed today, they walk you through the creation of a simple (very simple) RSS reader in PHP.


    In this article we are going to discuss how to create a PHP-based RSS reader. It would be helpful if you know something about XML, but not really necessary. RSS documents have three main tags: Title, Link and Description. And they all do exactly what their names suggest. I will go into detail about these tags in my second article dealing with building an RSS file. For now, we will only focus on the reading part of the article.


    They start with an overview, showing where you'll come from and where you're headed to. They include a section introducing the XML handing functions (SAX, not DOM) and use them in a chunk of code to read in the RSS file and handle the contents.

    Read More

  • SitePoint.com: Create Dynamic Images with ImageMagick

    What if your site could change the appearance of images on-the-fly, in response to user interaction? Well, it can. As Michael explains, by integrating ImageMagick with your site, you can allow users to resize maps, rotate aerial shots, zoom in on product shots, and more.

    Read More

  • SitePoint.com: The CakePHP Framework: Your First Bite

    CakePHP is a mature framework for PHP developers who want the structure and time-saving benefits of Ruby on Rails, without having to leave their comfort zone. As Fabio explains, CakePHP's scaffolding lets us build a prototype application quickly, using minimal code. Cake also offers many helper classes to extend and customize your application while retaining a sensible and easily maintainable architecture.

    Read More

  • JSLabs Blog: 5 tips for creating high performance web apps

    In this new post, Justin Silverton shares a few helpful hints for creating high performance applications in PHP:


    • use multi resultset queries to your database rather than many small ones
    • page/object caching
    • gzip compression
    • tune your web server
    • Don't save performance testing for the end of the project


    Each of the items has explanation and links to more details on them (including links to three difference object caching applications - ion cube, alternative PHP cache, turck MMCache).

    Read More

  • DevShed: Using Abstract Factory Classes in PHP 5 to Work with Online Forms

    DevShed has posted the final installment of their series looking at the creation and use of the Abstract Factory pattern. In this new part, they focus on the creation of online forms and their handling as the pattern is applied.

    In this last installment of the series, I'm going to show you how to use an abstract factory class to create distinct types of form objects, logically depending on the context where they will be utilized. The idea not only sounds interesting, but it can provide you with a better understanding of how this handy pattern can be used in a real situation.

    They start by defining their abstract factory form class and extending it to create a required form element and a normal form element. They make input functions for each - required input box, required radio button, required check box - and their "Normal" counterparts. Finally, they tie these all together to create a simple form with sets of an input box, radio set, and checkboxes both required and normal.

    Read More

  • Interspire.com: Creating a Basic Shopping List Script with PHP

    Instead of eating too much take-away when we're at work, most of the guys now subscribe to various "healthy eating" principles. We use a PHP shopping list script to keep track of the things we need to buy. In this article I'll give you a basic outline of how the script works.

    Read More

  • PHPBuilder.com: Beginning Ajax with PHP: From Novice to Professional

    PHPBuilder.com has another in a series of book excerpts posted on their site today. This time, it's a look at Ajax and PHP as pulled from the Apress book "Beginning Ajax with PHP: From Novice to Professional".

    The ability to make a call to the server without a page refresh is one that is quite powerful, if harnessed correctly. With the help of the powerful PHP server-side language, you can create some handy little applications that can be easily integrated into any web project.

    They take some time to explain what an Ajax connection is before getting into the code - a basic example that just shows/hides content. They include both the HTML/Javascript to handle the front end and the PHP to handle the backend creation of the calendar (the content) itself.

    Read More

  • Vexxhost.com: Top 5 new (and cool!) features in PHP5 that you probably haven

    From the Vexxhost.com blog today comes a quick overview of some of the "new and cool features" of PHP 5 that you might not have heard of - a top five list.

    PHP5 has brought so much new features but because of its big syntax changes, a big percentage of the PHP developing base has not made the change. Here are the top new features that could change your mind.

    The list they've created includes:


    • Better error handling with exceptions
    • Completely rewritten MySQL extension
    • A heck of a lot more useful functions
    • Finally! SQLite database support!
    • The best damn OOP support period

    with each having a bit of a explanatory paragraph...

    Read More

  • NorthClick Blog: Tips for creating a small but solid newsletter-system

    On the NorthClick blog today, there's a quick little set of hints talking about the creation of a simple ("but solid") newsletter system for your website.

    He breaks it down into the individual steps you'll need to follow:


    • Use a Framework
    • Queue in the database
    • Use SMTP
    • Check Headers
    • Test it

    In the step involving the database, he gives the create script you'll need to get the table set up and working. It's not so much a step-by-step tutorial with all of the needed code as it is a general look at what steps to follow when rolling your own newsletter setup.

    Read More

  • php|architect: November 2006 Issue Released

    The latest edition of php|architect magazine has been published - the November 2006 issue. Articles included in this month's edition include:


    • "Services made simple with PHP" - Caroline Maynard, Graham Charters, Matthew Peters, Megan Beynon, and Simon Laws
    • "Tune Your Search Results With Ajax" - Will Fitch and Greg Black
    • "Synchronizing the World" - Sherman Lilly
    • "Learning from Ruby on Rails" - Chris Hartjes

    as well as the latest installments the Security Corner and Test Pattern columns.

    You can check out the full contents of the issue here and, if you just want to subscribe to this great PHP publication, you can check out their digital edition and print edition options.

    Read More

  • Hiveminds: How to Bridge PHP and Java for Powerful Web Solutions

    Hiveminds has published a new tutorial today that looks at bridging the gap between Java and PHP by allowing the execution of Java jar files from within PHP.

    Here's how to team up two of the most popular and powerful platforms for web development together. With the php-java bridge you can build classes and jar files in Java and call them and use their methods in PHP. Use the quick and easy PHP language to bring Java muscle to your web pages

    They step you through the creation of an autoexec file, briefly touch on the Wampserver package, help you get the php-java bridge installed, and give you some sample Java code to play with. It's a pretty basic almost "hello world" kind of example that they give the PHP code for as well, showing how to execute it from within your code.

    Read More

  • php|architect: Zend Framework - A Practical Tutorial

    On php|architect's site, in wake of the Zend Framework preview release previously, they've posted a step-by-step tutorial on how to get it installed, work it it, and ultimately create a simple news application.

    The Zend Framework has been unveiled! Although it is still in the early stages of development, this tutorial highlights some of the best of what's available now and guides you through the process of building a simple application.

    Zend has chosen to release the framework and involve the community early. In the same spirit, this tutorial is written to showcase the framework as it exists today. Because this tutorial is published online, I'll update it as the framework evolves, so that it remains relevant as long as possible.

    This isn't a tutorial for those that aren't into object oriented programming with PHP yet, as it relies heavily on knowledge or classes and how they work together. In the tutorial, they take you through everything - the install, the structure, and some more detail on what the packages are (Zend_Controller, Zend_View, and Zend_InputFilter). Once all of that knowledge is in place, they start the work on the news application, creating a script that uses a more MVC approach to interface with a SQLite database and allow users to enter news items and for an admin to approve them.

    Read More

  • Devshed: A Login System for a PHP Email Application

    DevShed continues on with their creation of an email application series with part two of the series - a look at the creation of the login system for the app.

    We know from the previous article that the user ID is very important, in that it is used to retrieve various information from the database at various stages of the application. The login form sets this userID when you log in. It is the login system that will be the focus of this second part in a four-part series.

    They give a simple screenshot of what the login will look like before getting into how to connect to the database, verify the user's information, logging in the user, registering new ones, and the code to work with the user's profile.

    Read More

  • Creating Search Engine friendly URLs with Apache and PHP

    Operating a successful web site demands smart search engine practices, and that includes the very URLs of your web documents. This article takes a look at how to create URLs that search engines relish. A friendly web site means more hits...and added success.

    Read More

  • Search Engine Optimizing PHP Scripts

    PHP pages have a reputation of being more difficult (or at least different) to SEO than static HTML pages. Here’s an overview of the major issues encountered when trying to optimize PHP script for search engines. While this focuses on PHP much of it is still relevant to SEO'ing dynamic pages in general.

    Read More