Homework: First Functions

Write a program called functions.php. In the functions part you will have: Create a function called CanDrive() that sends a provided age to determine if you are old enough to drive. Have the function return a Boolean Create a function called SayHi() that tell you good morning/afternoon or evening depending on what parameter you pass…

Read More

Naming Conventions for PHP & MySQL

PHP Function names should: start with a verb describe what the function does use the CamelCase naming convention Examples: function getRecords() function createUser() function viewTable() Variable names should: describe what type of information or data the variable holds be written using lowercase with underscores – no spaces! avoid using ambiguous variables like $i or $x…

Read More

Exercise 1

Write a small PHP program…..and do this: create an array with a list of what you want for Christmas. Loop through it and print each item. Remove off the last item Add two new items on. Echo a string – that tells what item #2 and item #4 is

Read More

Download Existing Website

Next? Go get your website app and put a copy of it on your computer. First, where do you put the files?  If you are using Windows – they go in the c:/xampp/htdocs directory. If you are using a Mac – it is a little more complicated.  As usual! Props to Margaret and Margot for…

Read More

Adding Existing Code to Git

Step 1 Open Git Bash Step 2 Change the working directory to the directory where your project is stored. In this case, I’m going to change over to the d:/xampp/htdocs/LabCats directory. Since, you are going to be working out of your local development environment for this one- it will probably be c:/xampp/htdocs/yourapp Step 3 Initialize…

Read More

Pushing to GitHub

Great.  Now all your changes are committed to your local development environment.  But, what if you working with others or updating a live site?   You will need to push your changes up to GitHub. How? Follow these steps: Step 1 In Git Bash navigate to the directory you want to pull the code from the…

Read More

Intro to GitHub

GitHub First step – go create an account on GitHub now. Public vs Private When you create a repository it can be either public or private What’s the difference? With a public repository – everyone can see your code. They can’t change it but they can see it. So use private if there is secure…

Read More