Friday, March 18, 2016

Huzzah for new projects

So the other day, I finally came up with a new project for my web site.

I decided to create a little insult generator, based of the works of Shakespeare.

First decision, how to do it. There were several possible options including hard coding all the quotes (bad!) and making a database for the quotes. The database idea seemed more complex than necessary.

So, the quotes are in a small xml file. Easy to edit, portable content, no problems there.

The page uses PHP to read in the xml file, pick out a few lines via random numbers and spit them out to the page. So in less than a day, I had the new project coded up and some insults added. The main delay has been reading a couple of plays looking for the insults.

No comments:

Post a Comment