Google Chart Tools

After spending way to much time trying to build and/or use different plugins to create dynamic and useful charts of different types my eyes was finally opened when I found the Google Chart Tools. You don’t need to sign up for anything nor pay for anything, it is completely free.

Read more…

Prepared statements with MySQLi

Todays update is all about databases and using MySQLi with prepared statements instead of using MySQL and mysql_connect. There are already a bunch of discussions about prepared statements so I will not go into details here. Basically it helps us protect our site against SQL injections, it runs faster and when preparing a statement the database will optimize the execution for the query.

Read more…

Multiple file upload with attachment_fu

Hi and  welcome to the first tutorial with Ruby on Rails. Today we are going to look at a file upload plugin called attachment_fu together with javascript to handle a multiple file upload form. We are not going to go into details about attachment_fu plugin nor every detail on Ruby on Rails. We aim low and see where we end up. 🙂

Read more…

SEO: Page title in your URL

We already covered the basic idea behind the friendly URL and how it can bring more visitors to your web page. If you missed the post where we discussed this and implemented the mod_rewrite module in Apache, you can read all about friendly URLs and our setup right here. One growing, important, feature nowadays is the URL. People didn’t come up with the idea of manipulating the URL people type in for no reason. It should be simple and easy to navigate through a website, right? Today we are going to make navigation via URL’s even simpler, especially for dynamically build up websites. This is the idea:

Instead of using id’s in the URL we are going to use the page title. We will not include the id of the object in the URL because if we had to do that, this wouldn’t make it easier to navigate through since you have to know both the id and title of the object. In this post we will take a look at how we can use a game title instead a game id in our URL. The visitors of the site can easily guess the title of the game and just type it in!
Read more…

The PHP Authorization Class

When you decide to work with PHP and MySQL you probably end up creating some sort of user controlled application. It might not be your first application but rather soon you start working with forms and suddenly you have created a login form and want to validate the user on every single page to see if the user is allowed to view the page content. Today I will present my PHP Authorization Class.

The authorization class will not take care of a login script or anything validating a user trying to login on your application. If you need a easy and fast login script you can read all about that on my SQL Login post. This class will take care of the page validation you need to do to make sure the logged in user is valid. This is done by introducing three different types: roles, resources and actions.

A role represents a user group for example guest, member, staff or moderator. A resource is easily explained as an object such as news, articles, users or games. Lastly the action is something you want to do such as add, delete, edit, view or list. With these three types we are able to specify authorization rules for various roles.

Read more…

Setting Up a Database with the MySQL Tools

Today we will take a look at the different options you have when you want to create a new database. We are going to use the MySQL Tools we presented earlier here on the site. We will look at two approaches on creating and setting up a database:

  1. Using the MySQL Administrator
  2. Using the MySQL Query Browser

The two approaches are very different. Using the first option you don’t need any SQL knowledge at all, everything is done in an interface meanwhile the section option is all about SQL and writing your own scripts. Depending on your knowledge of writing SQL code you should pick the option best suited for you.

Read more…

Designing a Database ER Model with Dia

When it comes to web development many people seem to forget one important thing. They all start with designing the graphics and page layouts and making sure the code follows every standard and conventions there is, but sadly that’s it. Many don’t think of database design as a important piece in the development. When you work on your code and you are connected to a MySQL database, how many times have you been forced to edit the database schema? If you answer is: many times. Boy, we have some work to do. The problem with designing a database might not occur when you are working alone or in pair but as soon as you start out with a three member team or larger a database design is highly recommended.

Read more…

PHP Code Standard and Name Conventions

Today’s web development requires a lot of know-how and a fair amount of knowledge about various languages. Creating a web page isn’t as easy as before. Now you need to handle graphics, flash, CSS, JavaScript, AJAX, PHP, ASP, JSP and so on. None of the web development scripts are strict concerning code standard nor name conventions. Having clean and neat code is a goal you should strive for. When working in small or larger teams it is important that other programmers can read the code you have written. You need to have comments on the tricky parts, use describing method and variable names and overall have a similar style and type of coding throughout your application or web site.

Read more…