IT250 Enhancing Websites with PHP Support Site

Current Unit: 01

  Due: 03-06-2013
e Newsletter
A newsletter published by http://technology.beyondmarrs.com/php/ to help students succeed!
Course: IT250 Enhancing Websites with PHP | Vol: 1301C | Issue: 1 | Date: 2013-02-28


From the Prof  FAQs

Greetings Class!

ProfI'm Kathy Marrs and I'll be your prof for the next several weeks as you learn how to enhance your web sites with PHP in IT250 starting on 2013-02-28

Currently I own Marrs & Beyond Technologies, a Web design and consulting company that specializes in database driven Webs using Flash, AJAX, MySQL and PHP. I am working on my PhD (ABD) and have an MS and EdS in computing technology in education.

Now that you know a bit about me, here are some tips to help you ace this course:

  1. Read the unit material before seminar each week. This gives you a head start on getting any answers you need and helps you participate more meaningfully.
  2. Practice the techniques thoroughly before implementing them into your projects. This will help reveal any gaps in your understanding and minimize the need to troubleshoot later on.
  3. Practice some more!
  4. Manage your time wisely. Do not let yourself fall behind. Though it is human nature to procrastinate, remember this is about your future and lack of planning on your part does not make an emergency on mine! Be sure to fully understand the late policy outlined in the FAQs.
  5. If you cannot attend seminar, it is your responsibility to review the recording so you don't miss vital information relevant to the unit topic and project expectations.

Now please take a few moments to introduce yourself to the class by posting a brief bio in Unit 1 discussion board. It would be helpful if you let me know of any specific learning goals you may have related to the subject and help your classmates learn of any interests you may have in common.

Also be sure to read the syllabus and any announcements I’ve posted. As you do, jot down any questions or concerns you have and bring them with you to seminar or post them in the Virtual Office. Remember, too, I'm only a few clicks away via email at kmarrs@kaplan.edu .

NOTE: If you do not receive a response to an email within 24 hours (except Saturday and Sunday) check your junk or spam folder. If you can't find it there, let me know in the Virtual Office.

I've designed this weekly newsletter to help you ACE the course! In it you'll find tips and other resources along with answers to frequently asked questions and best of all, specifics about how to maximize your points on your weekly projects.

The frequently asked questions (FAQs) to the right provide you with details on course expectations as well as what resources and software you need to succeed. The project due dates section helps you plan your schedule, so be sure to mark your calendars.

We'll be discussing all of these things in our first seminar, so be sure to bring your questions and concerns with you.  Hope you can all attend!

Warm Regards,
Kathy

 

Q: When are office hours?
A: Saturday & Sunday 3-4 PM ET on Google Chat

Q: What book do I need?
A: PHP and MySQL for Dynamic Web Sites 4th Edition
Author: Larry Ullman
eISN: 9781256767923
Publisher: Peachpit Press

Q: What software do I need?
A: HTML & PHP Editor (CodeLobster, Notepad++ or Dreamweaver any version);
I strongly urge you to use Dreamweaver! You'll find it highly beneficial to use an authoring tool that displays line numbers and code colors.

WAMP for Windows (Free download) http://www.wampserver.com/en/download.php or MAMP for Mac http://www.mamp.info/en/index.html

Q: What is the late policy?
A: 1-7 days late = 20% penalty
8-14 days late = 30% penalty
No projects will be accepted after the last day of the term.

You MUST email me to notify me of any project submitted after the grading period for that unit has been completed. With rare exception, projects more than 14 days late will not be accepted.

Q: When are projects due?
A: See schedule below.

  • Unit 1: 03-06-2013
  • Unit 2: 03-13-2013
  • Unit 3: 04-03-2013
  • Unit 4: 04-03-2013
  • Unit 5: 04-10-2013
  • Unit 6: 04-17-2013
  • Unit 7: 04-24-2013
  • Unit 8: 05-01-2013
  • Unit 9: 05-08-2013
  • Unit 10: 05-15-2013

Q: How can I get help?
A: You have several options depending on what you need help with as follows:

  1. Go to the Support Site. There you will find:
    • Weekly newsletters
    • Links to seminar recordings
    • Seminar agendas
  2. Join me for office hours (see schedule above)
  3. Post course related questions in the Virtual Office (I look there first and frequently)
  4. For issues of a more personal nature, use email
  5. If this isn't enough, check out Kaplan's Technology Center for tutoring options!

SEMINAR RECORDING


The seminar recording covering the following topics is here http://khe2.adobeconnect.com/p4tqjg4fbqj/

Preliminaries


  • Introductions and survey on programming knowledge
  • What I expect from you
    • Understand the syllabus
    • Do the assigned readings
    • Practice, practice, practice
    • Read my announcements
    • Do the work and participate!
    • Have fun!!!!!
  • What you can expect from me
    • Timely communication
    • Comprehensive grade feedback
    • Information packed seminars
    • Lots of support!
    • Fun!!!
  • How to Get help
    • Virtual Office (I look there first and frequently)
    • The PHP support site
    • KUO Technology Center - link under Course Home
  • Introduction to Web Development with PHP
    • What is PHP and what can it do - or what can you do with it?
    • What is MySQL?
    • WAMP, LAMP, MAMP and the Web

This week's goals


  • Download and install the W/L/MAMP servers
  • Understand how to use it
  • Create a Web page that displays your name using the PHP echo statement
  • Project Demo

Project Instructions


Install WAMP

From the website http://www.wampserver.com/en/download.php you will download the latest copy of the WAMP software. The download location should be noted. When the download is complete you will double click on the file (or choose Run from the dialog box). The installer will prompt you to accept the license (click ok). It will then choose the location for the software to the default location of c:\wamp (click ok). It will create a shortcut folder in your start menu (click ok). The Auto Start option will load WAMP each time you boot your machine it should probably be unchecked. The install will now proceed.

Upon completion of the install, you will find a new folder in your C drive, named wamp. Upon opening that folder you will find a folder named 'www'. This is the root folder of your web server. To start the Server, click on Start>Programs>WAMP Server>Start WAMP Server. This begins a process that will show in the system tray (lower right of taskbar) as a 'dial'. You may click on the dial and select 'localhost' and you will see the default 'index' page for your server.

A video tutorial is available in the Reading section of this unit, named SavingFilesinWAMP.

Note: http://localhost/ is equivalent to http://127.0.0.1 used in your book.

Create Your First Script

Using a text editor (I recommend using Dreamweaver), create a simple PHP program, named myLastName.php mylastname.php (use your actual lastname: e.g. marrs.php, use all lower case and do not use spaces or any non-alphanumeric characters in file and folder names). The PHP program should echo your full name in H1 tags. See the examples for Unit 1 on the PHP support site here http://php.skillbuilderblocks.com/. Create a subfolder named unit01 in the www folder in the WAMP area. Save the file in that subfolder. Make sure WAMP is running and all services are turned on. Click the WAMP icon in the system tray and click Localhost to test the script (Localhost opens your default browser at this address: http://localhost/). Scroll down the page and under Your Projects, click the unit01 folder to open it and click the file that is listed there.

Directions for Submitting Your Project
1. Zip the unit01 folder that contains your PHP file and your DB export and submit it in the drop box.
2. Go to the Dropbox by clicking on the Dropbox tab above.

Be sure to refer to the rubrics for details on what's expected to earn full points!

Project Demo


BROWSER OUTPUT (http://localhost/unit01/marrs.php) WITH WAMP SERVICES RUNNING

Adding comments to your code

Note that comments will not appear in the outputted results

The following examples both display the text string in the echo statement in the HTML <h4> format.

HTML embedded in PHP

Hello World!

PHP embedded in HTML

Hello World!


The code the produces the output above(screenshot)

unit01.gif

    PHP is a server side language, meaning whenever the browser encounters <?php, called the php delimiter, the browser passes control to the server which then processes all code up until the server encounters the ?>, at which point the server passes control back to the browser. There are a few key things you need to know about server side code

    • You cannot view php source code in the browser, only client side code (i.e. html, CSS, javascript, XML).
    • Both client and server side are written in plain text, so you can use php echo or print statements to embed client side code along with content that the browser will render exactly the same as if you wrote it in the client side language.
    • The php language is interpreted by the server, meaning it reads from left to right line by line. This also means, unlike compiled languages, errors are detected at runtime. The code will continue to execute unless the interpreter encounters the ending delimiter as stated above or it encounters an error. Learn to embrace errors and pay attention to line numbers. If you have an error on line 10 of 30 lines of code, simply fixing that error doesn't mean there aren't additional errors on one or more subsequent lines. The good news is the higher the line number an error occurs on, the closer you are to flawlessly running code.
    • The line number referenced in a php error message means the error actually occurred on a line above that. More on errors and troubleshooting them later.

    Study the unit 1 demo screenshot and see if you can identify the points at which the browser or the server controls the flow.