PHP Intro

We had a great PHP intro from Alex.

  1. I really liked the way Alex taught the class. He had about 7 slides and with each slide, he showed us some code and then asked us what we thought it would do.  Then we pasted the code in a scripting site to see if we were right.  He went through the 4 options in the ‘universal machine’ slide (input/output, assignments, conditionals, loops) and showed us how to do each one in PHP.   He also encouraged us to use the Lynda.com and codecademy.com PHP tutorials.
  2. LAMP stack is Linux, Apache, MySQL, PHP.  There are also MAMP (Mac) and WAMP (Windows).
  3. Basic components of Turing’s universal machine (he cautions that this is grossly simplified):
    • input/output mechanism (x goes in, y comes out)
    • capacity to do assignments (x=y)
    • ability to do simple logic/conditionals (if x then y)
    • loops/ability to repeat things over and over again (do x, y times)
  4. Basic PHP Syntax
    • A PHP script can be placed anywhere in the document
    • It usually starts with a <php and ends with ?>
       php
       //PHP code goes here
       ?>
      
    • The default file extension for PHP files is “.php”.
    • A PHP file normally HTML tags, and some PHP scripting code.
Sarah Witte

Author: Sarah Witte

As the Research and Collections Librarian for Gender & Women’s Studies I hope to build technical literacy in support of research in social history, especially involving census, GIS, textual data and primary resources. I am also interested in database design and architecture and the assessment of user interfaces.