PHP
Working With CodeIgniter’s Controller
Let’s face it, the app we’ve been building isn’t much good without the ability to dynamically add tasks instead of having to pull up a database editor so we can insert them ourselves. Today, we’ll discuss how to create this. But before we do, we have to add a categories drop-down list that pulls its data from the database. That’s extremely easy to do in CodeIgniter. First, let’s add some tasks. Open up your database editor of PHPMyAdmin (or whatever… continue…
Add CSS, Database Tables to Your CodeIgniter App
In my last installment, we set up a framework so we could begin building the app we’ll dig into today. Before we go any further, however, we need to do two more things. See All of Scott’s CodeIgniter Stories. First, our app has no styling. Here’s some basic CSS so we have something that’s at least a little more attractive: This isn’t a CSS tutorial, so I won’t go over the code in depth. It’s fairly straightforward, anyway. All I’ve… continue…
How to Build a To-Do App with CodeIgniter
Now that I’ve introduced you to the framework, it’s time to get started on our project. We’re going to be creating a to-do app, step-by step, over the course of the next few tutorials. Today, we’re going to do the initial configuration and I’m going to introduce you to a helper, specifically the form helper. This is something you’ll always want to include in your autoload file because it is going to be called all the time. What good is… continue…
How to Build a To-Do App with CodeIgniter
Now that I’ve introduced you to the framework, it’s time to get started on our project. We’re going to be creating a to-do app, step-by step, over the course of the next few tutorials. Today, we’re going to do the initial configuration and I’m going to introduce you to a helper, specifically the form helper. This is something you’ll always want to include in your autoload file because it is going to be called all the time. What good is… continue…
Modeling Data With CodeIgniter
This is going to be the last chapter in my series on CodeIgniter before we begin our project. It’s important to understand how to model data for consumption by views. I’m not going to go into the basics of MySQL here. There are plenty of courses out there to learn about that. For a lot of what you do in CodeIgniter, you’re not going to be writing SQL, anyway. We’ll be using CI’s ActiveRecord. Please note this is not Ruby’s… continue…
How to Build Controllers and Views with CodeIgniter
Now that we have the CodeIgniter configuration out of the way, let’s get started with our first controller. We’ll also create a view for it, and then we’ll pass data from the controller to the view. Creating a controller is fairly easy once you’ve done it a couple of times, but at first it can be a bit confusing to someone with little experience in PHP. There are three major rules for controllers: They must have names that are legal… continue…
Getting Started With CodeIgniter
CodeIgniter is a popular PHP MVC framework that’s developed a following for a variety of reasons: First, it’s very well documented. Second, there’s a lot of support for it in forums — people are familiar with it and generally happy to help. Third, there are many, many tutorials out there on how to use it. Fourth, it’s free. And fifth, it’s MVC. This is the first in a series where we’ll delve in CodeIgniter. We’ll start with an introduction to… continue…
‘Hello, World’ and Other PHP Basics
Since this is my first column on PHP for Dice, let’s start at the beginning. The common convention in learning any language is to introduce it through a “Hello, World” application. This application, as you probably know, is designed to give new users the satisfaction of having completed a project while introducing the language. In PHP, this application couldn’t get more basic and isn’t very interesting. On any PHP page, just type: <!–?php echo ‘Hello, World’; ?> That’s it. Like… continue…
How to Produce Dynamic Mulitplayer Games With PHP
It’s relatively easy to set up a Web-based massively multiplayer game (MMO), though realistically you probably won’t have more than a few hundred players. I’ve chosen World of Phaos (WoP), which you can access from the SourceForge.net, an excellent site for open source projects. WoP is a PHP, MySQL game and can run on a shared server, VPS or dedicated server. Shared servers are cheaper and are just fine for most games, but will generally limit you to running PHP/MySQL… continue…

