PHP and Scripting

Tutorials concerned with PHP and general scripting

phppoemscript1

A PHP poem

We all know PHP is a lot of fun in on itself but let’s put some basic skills into making a creative script. Something, you probably wouldn’t even consider doing because it seems like a waste of time. Don’t laugh, I know what you’re thinking. And I know that you’ll laugh when you finish reading this article.

So how about we write a PHP poem. :) Yeah, you think it’s silly, but so what? I found that making useless fun code is the best way to learn, at least for a beginner. It helps getting used to setting up the variables, doing switches, and making sense of forms.  I wrote this piece of code when I started out with PHP a couple months ago. Now let’s start!

First, set up the variables. I decided to make my poem a bit “dynamic” (or rather interactive) so I used some different feelings that the user can choose from: More >

PHP error reporting script

We’ve all encountered errors, especially during the synthesis of a new code. This is what a typical error looks like when you run it at a server at home:

Parse error: parse error in C:\directory\10_3.php on line 4

Here, we know that the error was a parse error and that it happened in a file called 10_3.php and it was on line 4. A parse error is typically just a missing semi-colon or a bracket. Nothing major, but it still triggers a fatal error. You can read all about the different errors and how to deal with them in the PHP manual or at this nifty Zend tutorial. I learned most of my PHP skills from that tutorial so read through it because it will definitely help you out.

More >