- If you're a member of the lynda.com online training library, you have access to the Exercise Files for this course. Download them from the course page and save them in a convenient place on your local computer. I've got them here on my desktop. So let's just take a look at them. All the Exercise Files are organized in folders numbered after each chapter. And inside are subfolders for the individual videos that require Exercise Files. When a file is in a different state at the end of the video, _end is appended to the file name.
If the video starts with a blank file, only the version with _end is provided. And in some cases, let's just take a look at Chapter Nine, where a lot of files change during the course of the video, there are two separate folders: begin and end. This is what the files look like at the beginning of the video and this is what you should end up with at the end. PHP files need to processed by a web server. So you need to copy all of the Exercise Files to your testing server root.
The location of your server or document root depends on your testing environment. In MAMP on Mac OS X, it's at /Applications/MAMP/htdocs. If you're using the built-in version of Apache on Mac OS X, it's at /Library/WebServer/Documents. In WampServer, it's on your C:\wamp\www. And in XAMPP on Windows, it's on C:\xampp\htdocs.
If you're using your remote server for testing or when you eventually want to show off your new skills, the name of the document root can vary. On many sites, it's htdocs. public_html is also common as is www. To use the Exercise Files, copy the Exercise Files folder and all of its contents to your server document root folder. Rename the folder to introducingphp as one word and all in lowercase.
File and folder names in a website become part of the URL, so they should never contain spaces. It's also a good idea to use all lowercase because most PHP servers are case-sensitive. If you set up the Exercise Files like this in a local testing environment the URL for every file will be http://localhost/introducingphp/ http://localhost/introducingphp/ followed by the folder names and file name. After you've copied the files and renamed the folder, make sure that your testing server is running and type the following URL in a browser address box: http://localhost/introducingphp/introduction/test.php http://localhost/introducingphp/introduction/test.php And if everything is working correctly you should see the following message.
This day of the week here is generated dynamically by PHP. So it will differ depending on when you test this page. If the day of the week is out by one, it means you need to fix the time zone on your server. We'll deal with that later in the course. And if this page is working you're ready to continue with the course. If you couldn't display the test page, check the following: Is the web server in your testing environment running? In most cases, this will be Apache.
Can you view other PHP files on localhost? If you can't, you need to fix your installation of Apache and PHP first. But if you can view other PHP files, did you copy the Exercise Files folder to the server root? Did you rename the folder to introducingphp as all one word? And did you spell the URL correctly? Mistakes in file and folder names are a common cause of problems. Hopefully, that checklist will get you up and running.
Author
Released
11/20/2015- Naming variables
- Storing text as strings
- Doing calculations with PHP
- Using conditional statements to make decisions
- Creating custom functions
- Deciphering error messages
- Emailing the contents of an online form
- Dealing with multiple-choice form fields
Skill Level Beginner
Duration
Views
-
Introduction
-
Welcome1m 11s
-
Using the exercise files4m 14s
-
-
1. Checking Your Setup
-
2. PHP Basics
-
PHP: The big picture6m 39s
-
Comments and white space6m 7s
-
Joining strings9m 4s
-
-
3. Making Decisions with Conditional Statements
-
The truth according to PHP3m 21s
-
Setting a default value8m 52s
-
-
4. Doing Calculations with PHP
-
Arithmetic operators9m 15s
-
Challenge: Integer division1m 18s
-
Solution: Integer division3m 27s
-
-
5. Using Loops for Repetitive Actions
-
Using a for loop5m 44s
-
Alternative syntax for loops2m 32s
-
6. Using Functions and Objects
-
Creating custom functions7m 53s
-
7. Including External Files
-
Using server-side includes3m 32s
-
Using include and require8m 16s
-
Examining the include_path5m 12s
-
-
8. Handling Errors
-
Dealing with PHP errors1m 27s
-
-
9. Emailing the Contents of an Online Form
-
Blocking suspect phrases8m 2s
-
Preparing to send email5m 10s
-
Automating the reply address7m 46s
-
Building the message body10m 18s
-
Sending the email5m 7s
-
Troubleshooting mail()3m 17s
-
10. Dealing with Multiple-Choice Form Fields
-
Introduction1m 58s
-
Handling checkbox groups7m 26s
-
Handling select menus6m 21s
-
-
Conclusion
-
Where next?1m 56s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Using the exercise files