Wednesday, February 23, 2011

Hello World! Day 1

Can't sleep so I busted out the old PHP book at 1:00 in the morning.

The book I'm using is PHP: Fast & Easy Web Development, 2nd edition by Julie Meloni. Although it might just be called PHP, I'm not quite sure. I think it was published back in 2002, but on a tight budget and a severe lack of experience, it fits my needs quite nicely.

The book does a great job of walking you through every little step of the PHP process. In the first few chapters, it assumes you are a moron and know nothing of the language. Basically, it's perfect for me. So far I've learned the "echo" print executor, predefined variables, constants, and some basic operators. The operator types are pretty straight forward: assignment, arithmetic, comparison and logical operators. You can use these operators to take your predefined variables and transform them or set them for testing. Logical and comparison operators, for example, can be combined with "if...else" and "while" to determine truthy and falsey and then print the results.

A specific-er example is setting a predefined number variable for a temperature and a string for "hot" or "cold" and then use comparison operators to determine if the variable meet certain qualification and then outputting the general temperature via "echo".

Screw you, I think it's pretty damn cool.

I started the next chapter of pulling variables from forms to run through a php script. This is the equivalent of just learning to walk and immediately getting hit by a damn bus. My HTML experience is limited, so just setting up the form properly was a struggle. Tomorrow, I'll write the calculation php script that should crunch the input numbers and spit out a result.

Got plenty of time to do so without the looming shadow of a pending alarm clock.

No comments:

Post a Comment