Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Beginning PHP <ul><li>Session #3 </li></ul><ul><li>November 30, 2010 </li></ul>Josh Butts
Agenda <ul><li>Application organization </li></ul><ul><li>Superglobals </li></ul><ul><li>Forms, GET and POST </li></ul><ul...
Superglobals <ul><li>Available in every scope, no matter what </li></ul><ul><li>Automatically set by PHP </li></ul><ul><li...
$_GET <ul><li>Associative array corresponding to the query string </li></ul><ul><li>Use this for READ ONLY data </li></ul>
$_POST <ul><li>Associative array that corresponds to form POSTs </li></ul><ul><li>Use this when you will be modifying some...
$_POST
$_SERVER <ul><li>Contains environment information </li></ul><ul><li>Contains information about the HTTP request used to ac...
Sessions <ul><li>Keep track of info about your user </li></ul><ul><li>Each user gets an ID and a cookie </li></ul><ul><li>...
Using Sessions <ul><li>Call session_start() </li></ul><ul><li>Use $_SESSION superglobal to get and set data </li></ul><ul>...
Session Demo
Dates & Times <ul><li>Dates & times are relative to the timezone of your server </li></ul><ul><li>time() - Unix Timestamp ...
extract() <ul><li>Registers all the keys in an array as variables </li></ul><ul><li>Use extreme with caution </li></ul>
Let’s build something real something real
Upcoming SlideShare
Loading in …5
×

Geek Austin PHP Class - Session 3

986 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Geek Austin PHP Class - Session 3

  1. 1. Beginning PHP <ul><li>Session #3 </li></ul><ul><li>November 30, 2010 </li></ul>Josh Butts
  2. 2. Agenda <ul><li>Application organization </li></ul><ul><li>Superglobals </li></ul><ul><li>Forms, GET and POST </li></ul><ul><li>Sessions </li></ul><ul><li>Basic Dates & Times </li></ul>
  3. 3. Superglobals <ul><li>Available in every scope, no matter what </li></ul><ul><li>Automatically set by PHP </li></ul><ul><li>Arrays </li></ul><ul><li>#1 attack vector </li></ul>
  4. 4. $_GET <ul><li>Associative array corresponding to the query string </li></ul><ul><li>Use this for READ ONLY data </li></ul>
  5. 5. $_POST <ul><li>Associative array that corresponds to form POSTs </li></ul><ul><li>Use this when you will be modifying something on the server </li></ul><ul><li>Array keys correspond to HTML input names </li></ul>
  6. 6. $_POST
  7. 7. $_SERVER <ul><li>Contains environment information </li></ul><ul><li>Contains information about the HTTP request used to access this page </li></ul>
  8. 8. Sessions <ul><li>Keep track of info about your user </li></ul><ul><li>Each user gets an ID and a cookie </li></ul><ul><li>Actual session data is stored on the server </li></ul><ul><li>Low security but easy </li></ul>
  9. 9. Using Sessions <ul><li>Call session_start() </li></ul><ul><li>Use $_SESSION superglobal to get and set data </li></ul><ul><li>Sessions expire when the browser is closed (you can configure this) </li></ul>
  10. 10. Session Demo
  11. 11. Dates & Times <ul><li>Dates & times are relative to the timezone of your server </li></ul><ul><li>time() - Unix Timestamp </li></ul><ul><li>date() - format a date string </li></ul><ul><li>mktime() - get a specific unix timestamp </li></ul><ul><li>strtotime() - convert an english-ish string to a timestamp </li></ul>
  12. 12. extract() <ul><li>Registers all the keys in an array as variables </li></ul><ul><li>Use extreme with caution </li></ul>
  13. 13. Let’s build something real something real

×