CSC 341: The Week beginning Jan. 29
Homework:
Read and summarize the following article:
Now even YouTube serves ads with CPU-draining cryptocurrency miners
Salad Works
Salad Works Lab Instruction
(Word)
SaladWorks.html
(Head start on HTML file)
PHP number_format() Function
might help getting two decimal places for the money.
Submit zipped up files.
Due: Feb. 5
Monday:
color_data_2.zip
Added a fifth method that uses JSON to pass an array
Look at JSON format
Potter_new.json
Wednesday:
Demo of a single-page session variable:
SessionSinglePage.php
SessionSinglePage.zip
Demo of a two-page session variable (PHP writes JavaScript that sets value of input text):
SessionDemo1.php
SessionDemo2.zip
Demo: Variation of above where PHP writes directly to HTML value
SessionDemo1a.php
SessionDemo1a.zip
Demo of session variables versus cookies
CookieDemo.php
CookieDemo.zip
Demo: State Capital Quiz
(Uses $_SESSION, session_start(), isset, json_decode, shuffle, $_SERVER['REQUEST_METHOD'] )
StateCapitalQuiz.php
StateCapitalQuiz.zip
Other Resources
Programming PHP
(Tatroe, MacIntyre & Lerdorf) p. 192-201
Beginner PHP Tutorial - 73 - Setting PHP Sessions
Beginner PHP Tutorial - 74 - Unsetting PHP Sessions
Beginner PHP Tutorial - 75 - Creating Cookies with PHP
Beginner PHP Tutorial - 76 - Deleting Cookies with PHP
http://www.w3schools.com/php/php_sessions.asp
http://www.w3schools.com/php/php_cookies.asp
Dates.zip
(demos
date_default_timezone_set
,
getdate()
and
mktime()
)
FirstFriday.zip
Related Resources
http://php.net/manual/en/function.getdate.php
(php.net getdate)
http://php.net/manual/en/function.mktime.php
(php.net mktime)
http://php.net/manual/en/control-structures.switch.php
(php.net switch)
Friday:
Uhaul lab
Due: Feb. 9