Module 7
This week we worked on building functions in PHP instead of Javascript and to create a rollover image on a website. I chose a simple if/else statement that would tell a person if they were an "adult" or a "minor". The age is entered in the code and I chose the age of 21 so they function would display "adult". I am very used to JavaScript as I have been using it for years now, so getting used to PHP is taking some time. The main differences I see between creating a function are mostly through the syntax. As one may know, when you want to display something in PHP you have to use the word "echo" beforehand...in JS you do not have to do such a thing. Building the statement itself is pretty similar, You plug in a variable and if it does one thing the code will display another thing and if it does the opposite then it displays something else - it is the same concept with both PHP and JS.
Instead of using Dreamweaver, because honestly I cannot stand that application, I decided to code my own rollover image in my website. I chose to use images of my two favorite animals, cows and turtles. When the mouse hovers over the image it changes to a turtle, and when it leaves it goes back to a cow. I am familiar with making rollover images and the concept is not that hard actually. The only challenging thing is to make sure the syntax is completely correct when putting you images into your HTML. Overall, this week was very informative in learning how to use functions in PHP.
Instead of using Dreamweaver, because honestly I cannot stand that application, I decided to code my own rollover image in my website. I chose to use images of my two favorite animals, cows and turtles. When the mouse hovers over the image it changes to a turtle, and when it leaves it goes back to a cow. I am familiar with making rollover images and the concept is not that hard actually. The only challenging thing is to make sure the syntax is completely correct when putting you images into your HTML. Overall, this week was very informative in learning how to use functions in PHP.
Comments
Post a Comment