AWD-Assignments
Classes are broken into 14 Assignments.
For Fall & Spring semesters that are 15 weeks - we will do 1 Assignment per week
For Summer semesters that are 12 weeks - we will do 2 Assignments for the first 2 weeks and then 1 Assignment for the 10 remaining weeks
CANVAS CLASS https://vsc.instructure.com/courses/14909/modules
Assign01
due in approx 1 week, Note: Setting up your ClassWeb may take longer.
Please watch our Welcome video: https://www.youtube.com/watch?v=wCPl4gl-SQw
Research (Introduction)
Introduce yourself to the class. Tell us about what other classes you have taken, what you do for work/hobbies/passions, If you have chosen a degree or certificate, What your goals are for this class.
What type of computer you have Win/Mac, operating system Win10, OSx, Linux, etc.
What software applications you use, Microsoft, Word, Excel, Access, Photoshop, Flash, Dreamweaver, etc.
Have you learned any other languages? Python, Java, C++ or others
What Website(s) do you use most often?
Have you ever used W3Schools https://www.w3schools.com ?
We will be using W3Schools to learn about
You can share anything else you feel comfortable with that you think would help me when it comes time to explain a new concept - so I know something to attach the concept to.
Here is my Bio - My introduction to you. https://sites.google.com/site/jilmactraining/jil_macmenamin
Post your Intro to Canvas Assign01-Research-Intro
Make sure your CCV email is forwarding to the email that you use daily!
http://ccv.edu/2015/09/01/ccv-edu-email-coming-your-way/ Send me an email from your CCV email account to jam08260@ccv.edu
OFFICE 365 AND EMAIL SETUP
Code B+A (Upload to ClassWeb)
Read about our Textbook (On Line Resources from W3Schools) https://www.w3schools.com/about/
NOTE: ClassWeb.ccv.edu uses PHP Version 5.4.16 so do the PHP 5 tutorials
Anyone in class who is doing a LocalHost and wants PHP7 use it.
MySQL version 5.0.1
WordPress 4.1
PHP Install https://www.w3schools.com/php/php_install.asp <-- NOT REQUIRED for CIS-1152
CCV has their own Student Web Server ClassWeb.ccv.edu - PHP & MySQL are already installed on ClassWeb.
We will be using ClassWeb to upload and run our PHP programs LIVE on the web.
You will NOT need to install PHP on your own computer.
PHP Syntax https://www.w3schools.com/php/php_syntax.asp
Notice how W3Schools in the PHP tutorials doesn't have the "Try Me" instead it has "Run Example" because you need a server to run PHP code.
Read and set up your ClassWeb.ccv.edu server space
https://sites.google.com/site/jilmactraining/web-development/CLASSweb_ccv_edu
From W3Schools, copy the code for FirstPHPscript save it - this is your Before Code
Modify the FirstPHPscript by adding your name to the Upload your
Post your Intro to the Assign01 in Moodle or Canvas.
Post a link to the file, it should look similar to this:
Before: http://jam08260.classweb.ccv.edu/AdvWD/Assign01/FirstPHPscript.php
After: http://jam08260.classweb.ccv.edu/AdvWD/Assign01/FirstPHPscript-after.php
or
Before: http://jam08260.classweb.ccv.edu/AdvWD/Assign01/HelloWorld.php
After: http://jam08260.classweb.ccv.edu/AdvWD/Assign01/HelloWorld-after.php
Assign02
due in approx 1 week Note: You may still be setting up your ClassWeb, call JilMac if you want one-on-one support.
Research (Editors)
Editors - you can choose whatever editor you feel comfortable with to do your class work. You will see JilMac using a couple of editors
NotePad++ https://notepad-plus-plus.org/downloads/ then install Compare Plugin Steps: Plugins>Plugins Admin ... > Compare
NotePad++ Tutorial https://www.youtube.com/watch?v=FOfGv_c6ZrQ
Sublime Text https://www.sublimetext.com/
Sublime Test Tutorial https://www.youtube.com/watch?v=yvDyBgJphYE
Eclipse (you could spend the whole semester learning this IDE) https://www.eclipse.org/downloads/packages/release/2018-09/r/eclipse-ide-php-developers
Read WordPress's page on editors. It outlines many of the popular editors https://wordpress.org/support/article/glossary/#text-editor
Research a few editors - if you find one you like install it. Tell me about your editor and the features you like most. It could be the color coding, compare features to compare one file to another, how you can look at code from several programs side by side, etc. If you don't know about the topics I mentioned - then go research those, tell me what you learned and 3 links to where you learned about those features. Put the 100+ Words on your WebPage for Assign02. Put the link to the Assign02 Web Page in Canvas. If you have questions post them to the Assign02 Question thread in Module 2. If you have a question then others have questions.
Post your Research LINK to Canvas - Assign02-Research
JilMac gives an overview of Assignments https://youtu.be/duTV1OgkHwA
The idea with all homework is to have it LINKABLE from your Website on ClassWeb
All you need to put in CCV's LMS(Moodle or Canvas) is a LINK to the Research for Week2
Ideally you will have a Website on Classweb where each assignment will have it's own page
Here is my sample site: http://jam08260.classweb.ccv.edu/AdvWD
W3Schools Menu https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_responsive_navbar_dropdown
W3Schools CSS has Page Layouts https://www.w3schools.com/css/css_templates.asp
W3Schools CSS Responsive Degisn https://www.w3schools.com/css/css_rwd_templates.asp
W3Schools HowTo - Menu's & Building Blocks https://www.w3schools.com/howto
Here is a link to The Sample Menu's that are zipped http://jam08260.classweb.ccv.edu/WebDev/Menu/
Here is a zipped file with the code: http://jam08260.classweb.ccv.edu/AdvWD/Assign02/AdvWebDev-Menu.zip
Code B+A (PHP - running on Classweb)
Coding-Before & After Note: it may take you several weeks to complete this assignment.
1st you need to set up your Student Server Space https://sites.google.com/site/jilmactraining/web-development/wd-Assignments/CLASSweb_ccv_edu
JilMac reviews & demonstrates several types of Menus that students can use to set up their Web-Page (this is a CIS-1151 Web Dev Refresher)
These are the Menus from the video: http://jam08260.classweb.ccv.edu/WebDev/Menu/ This ZIP file contains the Menu used in the Adv-WebDev class: http://jam08260.classweb.ccv.edu/AdvWD/Assign02/AdvWebDev-Menu.zip
You can use any of the Menu systems demonstrated or another for your index page. I want you to organize the assignments on a separate page each. The LINK to this page - is all you need to post to Canvas. Unless you have a question or comment. I want all your work to reside on your WebSite. Canvas is for the school - once the class is OVER - you no longer have access to your work. With a website you will have access as long as you are at CCV, plus you can easily zip and download the site. Put your work for Assign01 on an Assig01 page, put your work for Assign02 on an Assign02 page on ClassWeb. And each Assignment after this. This is taking everything you learned from Web Development and moving it to Adv Web Development. Plus you will be adding new PHP & MySQL knowledge. It will take time - be patient with yourself. If you get stuck CALL - we can walk through it together. The faster you learn to ASK questions and APPLY the answer - the faster you progress.
Do these PHP Tutorials: Select 3 code examples for your Before & After examples to upload to ClassWeb & display on your Assign02 webpage
Helpful HINT about ELFileManager: Your can change the THEME in the ELFileManager that may make it work better on Mac Computers (Hint from a Student). Or even Windows. CONFIG button top left chose a different theme ie Moono theme and refresh our page I was able to delete files using an icon on the windows tool bar without right clicking. Then I could set it back to the default theme. Right clicking was making additional copies of files so there ended up being a mess of files in the folders on the sentora server instead of the few that we need for an assignment. It has been overly annoying and this solved it.
Assign03
due in approx 1 week
Research - Make external header, navigation & footer PHP files - put the assignment 3 hours of research into your Menu. (2 points)
Are you using Google's Advance Search when you research topics?
Do you Sort by Date?? Do you use Quotes? what does the minus sign mean when TOUCHING a word?
JilMac's YouTube Videos can be "Speed-Up" or "Slowed-Down" click the Gear/Settings Icon in bottom right of the YouTube Video and adjust Playback Speed you can also turn on CC=Closed Captions - in case you get tired of my voice, or just want to see how accurate Google is!!
Note: This video was for Assign02 in WebDev, using Google Web Sites - for Adv WebDev we use PHP Website.
PHP Include - I'm going to skip ahead to teach you about one of the most important features of server side languages.
PHP Require - is similar to PHP Include - but it STOPS the program/Webpage if the file is not found.
https://www.w3schools.com/php/php_includes.asp (same link ... I wanted to make sure you know the difference.)
Here is how I created a Menu index.php file that has no redundancy, and is easy to maintain!
JilMac demonstrates PHP Include https://youtu.be/eGviSn_M9YQ
Code B+A - worth 5 points this assignment (2 from the PHP Include Research to get your index.php menu program up and running for the 14 Assignments & 3 from the Before & After)
Do the PHP Tutorials: Select 3 code examples for your Before & After examples to upload to ClassWeb & display on your Assign03 webpage
If...Else...Elseif https://www.w3schools.com/php/php_if_else.asp
PHP Switch https://www.w3schools.com/php/php_switch.asp
While Loops https://www.w3schools.com/php/php_looping.asp
Assign04
due in approx 1 week
How does JilMac Grade?
Research
Begin the process of learning how to debug, PHP debuggers and MySql debuggers
Spend about 2 hours - identify resources that you would use in ADDITION to our text book.
Find some YouTube Videos and/or tutorials.
Give me 200+ words what you learned.
Compare is a great tool. Notepad++ some versions have the Compare feature built in and some versions you have to install separately.
To see files side-by-side - View > Move > Move to Other View
If lines of code are long you may want to turn on Word Wrap - View > WordWrap
Scroll Line by Line
NotePad++ JilMac Demonstrates the Compare Plugin for Debugging https://youtu.be/W_1N2h-oQmY
SublimeText you have to setup the Compare and Line Numbers
https://bitbucket.org/dougty/sublime-compare-side-by-side/src/master/ - Read the README.md file with any editor to install
Zoom Font Size = View > Zoom > Ctrl and Keyboard + or =
To see files Side-by-Side - View > Layout > Columns:2
Compare = Click on the TAB of the file you want to compare > Right-Click > Compare With
Line Numbers = View > Ruler
SublimeText JilMac Demonstrates the Compare Plugin for Debugging https://youtu.be/-3J23oQSKco
ADVANCED Research - We will not be covering but you should be aware of
PHP Framework/Scachofolding - Laravel https://www.youtube.com/watch?v=ImtZ5yENzgE&list=PLkceZXjwpt78w0ezrjHBkkBM2dNyAaJsM&index=1
ADVANCED Research - some students may want to expand this assignment, or add to their project, or earn Extra Credit by:
Research the various tiers of Shared Web Hosting.
Understand what Linux administration can be done at what $$ point (stand along server vs. shared web hosting, etc.)
How much Administration do you want access to/configuration of your website.
Research ini_set('display_errors',1); Put at the top of every .php file. It mades finding the bugs a lot easier.
https://www.w3schools.com/php/php_ref_error.asp
https://stackoverflow.com
https://www.php.net are all good places to do research
Code B+A
Do the PHP Tutorials: Select 3 code examples for your Before & After examples to upload to ClassWeb & display on your Assign04 webpage
Sorting Arrays https://www.w3schools.com/php/php_arrays_sort.asp
Superglobals https://www.w3schools.com/php/php_superglobals.asp
PHP What version of PHP is ClassWeb.ccv.edu running?
// Print PHP Info.
ECHO phpinfo();
MySQL - You need the Database information - so these lines have to go into your mysqli_connect.php file because you need to access the database to get that information. We don't learn about setting up a database until Assign06. So if you want to skip ahead to and load your WordPress site you can. Or you can run JilMac's file that has this code in it.
https://jam08260.classweb.ccv.edu/AdvWD/Assign04/PHPcodeforMySQL+PHP.php Usually about this time someone asks what versions - so I want you to have that info.
// Print the MySQL version.
ECHO "MySQL version on ClassWeb.ccv.edu is: ";
echo mysqli_get_server_info($dbc);
Another Debugging Function in PHP is file_exists() https://www.w3schools.com/php/func_filesystem_file_exists.asp
This debugging tool test to see if a file exists, and if you include a path, if a file exits in the folder
Assign05
It may take you longer than a week to do this assignment.
I encourage you to make an on-line appointment with JilMac if you have ANY questions during this assignment!
Plus you an an extra-credit point during the appointment for participating in a one-on-one onLine meeting.
Research (Tudor.com.com)
Learning how to ask for help, practicing working with Tutors, Support Personnel, User Groups, etc are all very important. I want you to use Tutor.com to ask a question.
Tutor.com:24/7 Online Tutoring is accessible from each Canvas Class from the Left-Navigation.
Note: Under CIS use 1151 Web Development or 1360 Database Management Systems of CIS-2140 for JavaScript or (they don't have PHP or MySQL) but if you ask for 2140 they may be able to answer some PHP questions.
Cut and paste the interaction and do a screenshot (because they will type in code to the screen)
To capture a screen use:
Windows: Ctrl-PrintScreen or Ctrl-PrtScr buttons.
Mac: Shift-CMD-3
Then open the image in an image editor to Crop out parts not necessary
and put the image onto your Assign05 page.
Give 100 words about the experience. Note: You may go back to Tutoring.com several times! It is a free service, and you only have to ask 1 question about programming, other questions can be about your other subjects.
Also Research - XML https://www.w3schools.com/xml/default.asp
You need to have a Server Side Language to Write/Update files on the server ...in this course, we use the server-side language PHP.
But Browsers can already read HTML, CSS, JS, Image Files, XML files
How does PHP READ from a file on the Server? https://www.w3schools.com/php/php_file_open.asp
How does PHP WRITE write to a file on the Server? https://www.w3schools.com/php/php_file_create.asp
Do you have to change the File Permissions on the Server to allow files to be Read/Written/Updated?
How do we know if a file is READ, WRITE, UPDATE capable? ELFileManager has the PERMISSION field.
NOTE: As of 2021 - Updating an XML file has not been possible due to strengthened security measures.
Code B+A (forms)
Do the PHP Tutorials: Select 3 code examples for your Before & After examples to upload to ClassWeb & display on your Assign05 webpage
Forms are the heart of web pages, they a major way Websites receive information about what you want from a system
PHP Form Handling https://www.w3schools.com/php/php_forms.asp
PHP Form Validation https://www.w3schools.com/php/php_form_validation.asp
PHP Form Required https://www.w3schools.com/php/php_form_required.asp
PHP Form URL/E-Mail https://www.w3schools.com/php/php_form_url_email.asp
PHP Form Complete https://www.w3schools.com/php/php_form_complete.asp
Create your own php program that READS from an XML file (there are lots of before examples to choose from)
Here is a simple State Name and State Code XML file at the bottom of this page.
Intermediate: (Only for those that want a challenge)
Can you create your own XML file? Can your program or form read your XML file?
Hartness Library - Online OReily Book: PHP 5 Advanced by Larry Ullman Chapter 14, has some great examples:
Log into CCV's Portal | Right-Nav | Student Resources | Hartness Library |
Search Field enter: Larry Ullman, PHP 5 Advanced |
scroll down to the PHP 5 Advanced and click View Full Text |
scroll down to Chapter 14 XML and PHP
https://learning.oreilly.com/library/view/php-5-advanced/9780321376015/ch15.html
NOTE: You can PRINT and SAVE as a PDF, Do a CUSTOM size of 200%
PHP 5 Advanced by Larry Ullman - https://larryullman.com/books/php-5-advanced-visual-quickpro-guide-2nd-edition/
Chapter 14 has some great examples http://jam08260.classweb.ccv.edu/AdvWD/Assign05/PHP5Adv-ch14/PHP5Adv-ch14.zip
XML http://jam08260.classweb.ccv.edu/AdvWD/Assign05/PHP5Adv-ch14/books1.xml
XML http://jam08260.classweb.ccv.edu/AdvWD/Assign05/PHP5Adv-ch14/books2.xml
XML http://jam08260.classweb.ccv.edu/AdvWD/Assign05/PHP5Adv-ch14/books3.xml
XML http://jam08260.classweb.ccv.edu/AdvWD/Assign05/PHP5Adv-ch14/books4.xml
XML http://jam08260.classweb.ccv.edu/AdvWD/Assign05/PHP5Adv-ch14/store.xml
Reads an XML file http://jam08260.classweb.ccv.edu/AdvWD/Assign05/PHP5Adv-ch14/simplexml.php
XML ExPat Parser http://jam08260.classweb.ccv.edu/AdvWD/Assign05/PHP5Adv-ch14/expat.php
Debugging can also include CHECKING if a FILE Exists.
W3school's file_exists() Function https://www.w3schools.com/php/func_filesystem_file_exists.asp only returns boolian. 1=Yes the file Exists, 0=No the file does NOT exist
From http://php.net/manual you get more robust examples because you are incorporating IF/THAN/ELSE
https://www.php.net/manual/en/function.simplexml-load-file.php
JilMac's example: http://jam08260.classweb.ccv.edu/AdvWD/Assign05/Form-Reads-from-XML/Form-Get.php looks for the file and if it finds it - the form goes along it's Merry Way.
http://jam08260.classweb.ccv.edu/AdvWD/Assign05/Form-Reads-from-PullDownXML/Form-Get_missing_file.php Does NOT find the form - and displays an error.
Advanced: (Only for those that want a challenge and completed the Intermediate) Make a copy of the Read form to WRITE to an XML file.
What has to happen on the SERVER side to the XML file in order to WRITE to the XML file?
If you have taken a Linux class - this is called CHMOD 777, Read, Write, Update
If you have taken the Operating System Class for PC's (Personal Computer's Win or OS)
Where do you change a files' permissions??
More on XML:
https://medlineplus.gov/xml.html
JSON vs. XML: https://www.guru99.com/json-vs-xml-difference.html
PHP XML Tutorial: Create, Parse, Read with Example https://www.guru99.com/php-and-xml.html
3 ways to write to an XML file: https://www.way2tutorial.com/xml/php-generate-xml.php
Drop Down box using XML file: https://www.plus2net.com/php_tutorial/php-xml-dropdown.php
WHO - World Health Org - Life Expancy in America http://apps.who.int/gho/data/?theme=main&vid=61780
Assign06
It may take you longer than a week to do this assignment.
I encourage you to make an on-line appointment with JilMac if you have ANY questions during this assignment!
Plus you an an extra-credit point during the appointment for participating in a one-on-one onLine meeting.
Research (load SQL)
Once we have learned about Forms in PHP - we are ready to start learning where and how the data will be stored.
In Web-Development we created an HTML form - that had some JavaScript to Submit the data - but all it ever did was either, write the fields back to the form, or send the data to an email. You NEVER stored the data for anything beyond a WebPage.
In Server Side languages (PHP, Java, C++, Python, etc.) you can WRITE to a file, XML file, or Database. This gives a website power.
In ClassWeb.ccv.edu we use the SQL database MySQL.
Read Chapters 4 Intro to MySQL and Chapter 5 Introduction to SQL from PHP and MySQL by Larry Ullman 4th Edition <-- Must be logged into Canvas
The book is available from the Hartness Library (Free) from the O'Reilly
The 5th edition is Newer - but lacks easy access to scripts & Errata
STEPS to get a book (also you can ask the library for help - they are avail by phone or by Chat)
In Canvas - from the Left-Nav - Select Hartness Library
click eBooks, search Larry Ullman, PHP and MySQL Visual Quick Pro for Dynamic Web Sites 4th Edition, scroll down to Chapter 4, then you can use the link below.
Chapter 4 https://learning.oreilly.com/library/view/php-and-mysql/9780132767576/ch04.html
Chapter 5 https://learning.oreilly.com/library/view/php-and-mysql/9780132767576/ch05.html
The CODE for Chapter 5 is found in the sql.sql file from Larry's Download we did in Chapter 5 - it is the TEXT for Loading the tables
NOTE: JilMac's version SQL-JilMac_updated.sql is at the bottom of this page!!
OR-Download it from Larry's personal Web site https://larryullman.com/books/php-and-mysql-for-dynamic-web-sites-visual-quickpro-guide-4th-edition/
All of Larry Ullman's books are wonderful with excellent code that runs!
AND PHP and MySQL for Dynamic Web Sites VIDEO!!!
Note: This may be of more interest to the student who has installed Local Host on their personal computers, than students using ONLY ClassWeb.ccv.edu
Accessing MySQL https://learning.oreilly.com/videos/php-and-mysql/9780132776134/9780132776134-004 (NOTE: You must be logged into CCV's Portal, and it logs you out after a period of inactivity) We will be using PHPmyAdmin.
Note: the first 5 minutes of this recording is for Local Host, only a few students are using this most of us are using ClassWeb.ccv.edu
The last 4 minutes go over PHPmyAdmin which is what we will use.
Hartness Library - Directions from a Fellow Student!!
HINT: READING>GET THE APP: I don't know how many of us have tablets (iPads or similar) but we all have phones probably that can handle apps.
ALL of O'Reilly publications are available on their app. The app and ALL the books are FREE courtesy of CCV. VSC and can be accessed via the app which is easy to use, searchable and well organized.
Its Easy:
Download the app and sign in using the same user id and password we use for our portal. https://www.oreilly.com/online-learning/apps.html (Links to an external site.) (Links to an external site.)All of his books are available there (and everything else they have published), you can copy and paste anything you need and airdrop it to your desktop if you want to, or e-mail it to yourself, etc. The text is much more readable, than the low res pdf that is available via access through Hartness Library using a browser print function, or the pdf that is available through export as pdf which is slightly better than the print function but still awful. (Those pdfs are most likely set for a monitor.)AND when you open the title that you have accessed at the library on your tablet it opens to exactly where one had left off using the browser at the Hartless library site. This means that we can take our class reading anywhere we go and when we have a few minutes we can read this riveting mystery instead of Ms. Christie's. Enjoy!
Code B+A (create WordPress site)
From the Textbook -https://larryullman.com/books/php-and-mysql-for-dynamic-web-sites-visual-quickpro-guide-4th-edition/
1. Create the WP site first. This creates the Database, then you can add the Tables Larry Ullman had code for in his books.
On ClassWeb - Students can have 1 Database each (with unlimited tables within)
Here are the directions:
Go to https://sites.google.com/site/jilmactraining/web-development/CLASSweb_ccv_edu
On the above page, there is a link to CMS WordPress
https://sites.google.com/site/jilmactraining/web-app-programming/cms-wordpress
It explains the process of Installing a Database, then WordPress on your ClassWeb.ccv.edu space
JilMac explains ClassWeb's Sentora's Database Management Tools
Using the SQL.SQL or sql_JilMac_updated.sql (at the bottom of this page)_from the Larry Ullman download to Create and Load MySQL Tables
Even though you are Limited to 1 database, you can have MULTIPLE INSTANCES of tables. What this means is - that EACH WordPress site, can have a PREFIX before it's TABLE name so that you can have multiple WordPress sites sharing 1 Database.
THE NAME of the WordPress site - can determine the TABLE names. ex. WP1 can have WP1-customerTable and WP2 can have WP2-customerTable.
PLUS you can add additional tables to your Database to use for learning PHP and MySQL interactions - which is what we will do for this class.
When you install WordPress - Install it with WP1 or some unique prefix, so all the WordPress code can go in a separate directory on ClassWeb, and to your Tables will have a separate prefix.
2. Load the files for WP
3. Find a Theme that is interesting to you.
Post a Link to your WordPress site in on your Assign07 page on Class Web.
You may want to add links to helpful WordPress resources
Post to Canvas a link to your Assign07 page from your website.
Assign07
due in approx 1 week
Research (Read Larry Ullman)
Continue your reading from PHP & MySQL by Larry Ullman
Use the Downloads, to get SQL.SQL code to create & load
Chapter 5, 6, 7, 8 and the SQL.SQL file OR jilmac's version
sql-JilMac_updated.sql also at the bottom of this page.
Also download and put code for Chapters 17-19
Chapters 4,5,6,7 give you a good basis for understanding MySQL
Chapters 16 - 19 show you how to incorporate MySQL into PHP code by examples feel free to jump ahead.
Chapter 16 shows you how to connect your PHP & MySQL code to your Databse(Assign08)
Chapter 17 gives you the code to create a Message Board for mb_ tables (Assign08)
Chapter 18 give you the code to create a User Registration for ur_ tables (Assign09)
Chapter 19 gives you VERY elementary code with NO SECURITY for an E-commerce site for ec_ tables (Assign10)
when you have loaded the tables into your Database
Post 100 words what you think of MySQL & loading Tables for Assign07 webpage
and any links that are helpful to the book, downloads, etc.
Post to Canvas that you are ready for me to grade your work.
Code B+A (Load SQL for Chap 5-7)
From the Larry Ullman downloads - the file SQL.SQL has the data for Chapters 5, 6, and 7
Load these tables INTO YOUR Database in ClassWeb's PHPmyAdmin.
Put 100 words what you think of MySQL & loading tables on your Assign07 webpage
Post to Moodle - Assign07 when you are ready to have me check that your Tables for Chapters 5, 6,and 7 have been loaded into your Database.
NOTE: Some students who are new to databases - may want to setup a one-on-one to do this together in Zoom or Google Hangouts.
If you have not been exposed to Databases or taken the Database class you may want to work with JilMac on this.
Remember ... you earn 1 extra credit point for working with JilMac on-line!!! Plus it is fun!
INTERMEDIATE - IF you want to create some PHP code that will READ the users TABLE that you created ....
You need to have your mysqli_connect.php file set up to work with YOUR Database, Username & Password
Here is what mine looks like: http://jam08260.classweb.ccv.edu/AdvWD/Assign09/Select/index-works.php
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Select from Database</title>
</head>
<body>
<h1> A simple query to the Database using PHP </h1>
<?php
ob_start(); // Start output buffering:
session_start(); // Initialize a session:
require ('mysqli_connect.php'); //Connects to the datase: CAREFUL in some directories this is mysqli- DASH not an Underscore !!
$q = "SELECT CONCAT(last_name, ', ', first_name) AS name, DATE_FORMAT(registration_date, '%M %d, %Y') AS dr FROM users ORDER BY registration_date ASC";
$r = @mysqli_query ($dbc, $q); // Run the query.
$num = mysqli_num_rows($r); // Count the number of returned rows:
// echo $num 'This proves that the SQL found records - this is just for Testing by JilMac' ;
if ($num > 0)
{ // If it ran OK, display the records.
// Print how many users there are:
//echo '<p>There are currently ' $num 'registered users.</p>';
// Table header.
echo '<table align="center" cellspacing="3" cellpadding="3" width="75%">
<tr>
<td align="left"><b>Name</b></td>
<td align="left"><b>Date Registered</b></td>
</tr>';
// Fetch and print all the records:
while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
echo '<tr>
<td align="left">' . $row['name'] . '</td>
<td align="left">' . $row['dr'] . '</td>
</tr> '; }
echo '</table>'; // Close the table.
}
else { // If no records were returned.
echo '<p class="error">There are currently no registered users.</p>';
}
mysqli_free_result ($r); // Free up the resources.
mysqli_close($dbc); // Close the databse connection.
ob_end_flush();
?>
</body>
</html>
Next week your Project Outline is due - but lets start thinking about it this week
JilMac explains what the Project Overview & Project are: https://youtu.be/B8p2FJLJdA4
Project Rubric (how my project is graded) https://drive.google.com/file/d/1dcrx1jp7Me1gF4t8QqbBSEkRINy6FuvA/view?usp=sharing
Assign08
due in approx 1 week
Research (Load SQL for Chap 16-19)
Continue your reading from PHP & MySQL by Larry Ullman
You have now read & loaded the tables for Chapter 5, 6, 7, 8
from SQL.SQL file or SQL-JilMac-Update.SQL
That same file ( SQL-JilMac_updated.sql <--Here and at the bottom of this page!! )
- has the code for loading Chapter 17, 18 and 19 tables.
Chapters 16 - 19 show you how to incorporate MySQL into PHP code by examples
Chapter 16 shows you how to connect your PHP & MySQL code to your Database
Chapter 17 gives you the code to create a Message Board (mb_)
Chapter 18 give you the code to create a User Registration (ur_)
Chapter 19 gives you VERY elementary code NO SECURITY for an E-commerce (ec_) site
Chapters 17, 18 and 19 are examples how to write small web systems. Please give me 100 words what makes a Web System different than a Web Site?? display to your Assign08 webpage any links that are helpful to the book, downloads, etc.
As you are running the programs below - remember to look in the tables that are being updated using PHPmyAdmin - to see how they are being updated! Take special note of Chapter 18 where you are adding a User - the password is encrypted in the Table!! Fun!!
You can watch the Assign06 Loading Tables Video as many times as you need!
Code B+A (upload Ch 17 PHP code, setup mysqli_connect.php file, edit code to use mb_, ur_, and ec_ tables)
NOTE - you do NOT have to do a Before & After, changing code - just Load the Tables and run the programs as is
Upload the program files from Chapter 17 Message Board (pages 519-558) - post a link to them on your Assign08 page
This is how it runs on JilMac's ClassWeb.ccv.edu
http://jam08260.classweb.ccv.edu/AdvWD/Assign08/ch17/html or
Note: all the references to Tables in the code need to have a mb_ prefix for the Message Board
Your mysqli_connect.php file MUST have access to YOUR database, user, password to work
File: includes/header.html - You MUST change Line 36, 42, 121, to use mb_ tables
File: post.php - You MUST change line 39 & 49 to use mb_
File: forum.php - You MUST change line 19 (in 3 places: from mb_threads, mb_posts and mb_users)
File: read.php - You MUST change line 20 (in 3 places: from mb_threads, mb_posts and mb_users in JOIN)
File: search.php - You MUST change line 25 to use mb_
a complete updated ch17 folder with all updates is at bottom of this page called ch17.zip
Question: When you are testing to make sure all the options are working ... you will notice that not all the languages work from the navigation.
to find out why - look in the header.php file (which is more of a menu then a footer ...)
The Language is selected from the mb_words table ... when you look in that table can you tell why some languages work and others don't??
Midterm - Project Overview due
JilMac explains what the Project Overview & Project are: https://youtu.be/B8p2FJLJdA4
Create a NEW Website - Select a NEW Menu
Write an outline for your Project - the Final is worth 30% of your grade
Details for Projects: https://sites.google.com/site/jilmactraining/Classes/project
Assign09
due in approx 1 week
Research - Do all the W3Schools MySQL tutorials listed below, how is W3Schools different than learning SQL from Larry Ullman's PHP & MySQL Dynamic Web Sites? - give me 100 words what you learned.
Upload the program files from Chapter 18 - User Registration (pages 559-604) - post a link to them on your Assign09 page
This is how it runs on JilMac's ClassWeb.ccv.edu
http://jam08260.classweb.ccv.edu/AdvWD/Assign09/ch18/html or
Notice: (your version many have issues!-the error messages are displayed on the right)
file: mysqli_connect.php (this is NOT the same file as ch17) update with your DatabaseName, UserName & Password
file: /includes/config.inc.php
Line 18 put in your REAL email address - you will be getting alerts that you need to see
Line 21 defines the BASE_URL this is a PATH (to index.php)... NOT a .... file because it issued in line 69 of the register.php file.
Line 24 defines where mysqli_connect.php is use .'../mysqli_connect.php'
Make sure in your Database the Table name is ur_users
file: ONLY IN THE TESTBOOK page , download code is already updated.
includes/footer.php needs line 7 updated to
if (isset($_SESSION['first_name'])) { the hint is in Larry Ullmans's errata file
file: login.php line 29 (select from) users needs to be changed to ur_users
file: forgot_password.php line 17 (select from) users needs to be changed to ur_users
file: forgot_password.php line 36 (update) users needs to be changed to ur_users
file: change_password.php line 35 (insert into) users needs to be changed to ur_users
file: logout.php nothing to change
file: register.php line 53 (select from) users needs to be changed to ur_users
file: register.php line 62 (insert into) users needs to be changed to ur_users
file: register.php line 70 change email address from admin@sitename.com to your CCV email address
NOTE: you should receive an email - to activate - this is just showing how it would get done
file: activate.php line 15 users needs to be changed to ur_users
As you are debugging the MailTO you may need to delete the test record over and over again from the ur_users table so that you CAN receive an email
IF you can't read all of the error message - you can Block-Copy-Paste the message into your Editor
Each error you correct will show you the NEXT error until they are all corrected.
This is hard ... if you feel yourself getting frustrated ... call JilMac ... work together!
After: the files were updated
Note: all the references to Tables in the code need to have a ur_ prefix for the User Registration
all code needs to be changed to YOUR table names ex. "users" now becomes 'ur_users''
register.php add ur_ to lines 53, 62
login.php add ur_ to line: 19
Because we gave a ur_ prefix to all the Tables for Chapter 18's User Registration system
NOTE: register.php on line 70 has the email address of admin@sitename.com will most certainly go to your SPAM folder-look for it there.
config.inc.php in the /includes folder line 22 needs to be where the index.php file is. line 61 is the email From, to look for in SPAM folder
Code B+A (W3Schools MySQL examples)
Do the MySQL Database Tutorials: Select 3 code examples for your Before & After examples to upload to ClassWeb & display on your Assign09 webpage
MySQL Database https://www.w3schools.com/php/php_mysql_intro.asp (on ClassWeb you have already created a Database for WordPress)
MySQL Connect https://www.w3schools.com/php/php_mysql_connect.asp
MySQL Create DB https://www.w3schools.com/php/php_mysql_create.asp (on ClassWeb you have already created a Database for WordPress)
MySQL Create Table https://www.w3schools.com/php/php_mysql_create_table.asp
MySQL Insert Data https://www.w3schools.com/php/php_mysql_insert.asp
INSERT INTO `JilMac`
(`ID`, `FirstName`, `LastName`, `email`, `phone`)
VALUES ('14','Jil','MacMenamin','Jil.MacMenamin@ccv.edu','802-254-8628');
MySQL Get Last ID https://www.w3schools.com/php/php_mysql_insert_lastid.asp
Assign10
due in approx 1 week
Research PHPmyAdmin - what is it? What can you do with it? How do you manually add and update records? We learned how to LOAD tables - How do we back up your Tables? What is the difference between backup and exporting data? and notes. Give me 3 tutorials either YouTube Videos, or written directions with links - 100 words.+
Read & Upload the program files from Chapter 19 - E-Commerce (Pgs 605-660) post a link to them on your Assign08 page
The ClassWeb Assign10 page give links to the Administration programs to:
ADD an Artist, ADD a Print
Run the eCommerce program
Note: all the references to Tables in the code need to have a ec_ prefix for the E-Commerce
filename.php add ec_ to lines: __,__
JilMac wants you to look through the files, to read error messages, and change the SQL within the PHP files.
As you learn to READ php code ... one place that even the BEST of students trip on - is viewing the image
in the file view_print.php on line 38 it calls the program show_image.php ... Don't forget to change those table names!!!
When you first run this program on your ClassWeb.ccv.edu site - there are NO Artists, there is NO Art, you have to add that data.
You can use PHPmyAdmin to add artists & Art - or use the add_artist.php program (pages 612-616)
You must add/upload the images to the /images directory or use Add_Print.php (pages 616-628).
NOTE: We have a known issue with ClassWeb in 2021 you can't UPDATE a file and you can't UPLOAD a file
We can use 2 work-arounds
1. Manually upload the Art-Print .jpg's to the UPLOAD folder on your server
2. Put the URL location of an image from either your Google Drive or one from https://www.pexels.com
As you are adding pictures to your shopping cart - look at the Tables in your Database by using PHPmyAdmin to see them actually update!
ADD Artist http://jam08260.classweb.ccv.edu/AdvWD/Assign10/ch19/admin/add_artist.php
ADD PRINT http://jam08260.classweb.ccv.edu/AdvWD/Assign10/ch19/admin/add_print.php
NOTE: We have a known issue with ClassWeb in 2021 you can't UPDATE a file and you can't UPLOAD a file - HelpDesk Ticket generated.
You will get the error message "No file was Uploaded"
The work-a-round is to manually add records to the ec_prints table
the print_id must be unique, and use the ec_artists table to select and artist_id, in the image_name enter the URL for the image.
Modify the image_name field from 60 bytes to 120 or more if you have a long URL for an image.
The show_image.php file will need to be modified to display an image in another location other than the folder "uploads" this can be an Extra Credit of 3 points if anyone would like to tackel it - otherwise download the image and manually upload it.
What had to be changed to get the add_print.php in Chapter 19 page 618 & 619 to work is LINE 30 - the path to the folder uploads.
Some of this was discussed in Chapter 11 script 11.4 images.php line 14
You had to manually create an ../uploads directory - where the uploaded files will reside.
If there is no uploads directory or it is not in the correct path - the program will tell you the file can't be uploaded.
The same is true for our add_print.php because we have to UPLOAD files to this folder. Although ... depending ... where you put the upload folder - and your path - it may be the same folder or you could have separate folders for separate assignments. I'll leave that to you.
Line 30's path is ../../uploads because the add_print is in the admin directory. The ../ equates to going UP 1 directory/folder ../../ is doing UP 2 directories/folders.
Code B+A
Do the MySQL Database Tutorials: Select 3 code examples for your Before & After examples to upload to ClassWeb & display on your Assign09 webpage
MySQL Insert Multiple https://www.w3schools.com/php/php_mysql_insert_multiple.asp
MySQL Prepared
MySQL Select Data Note: use the quote marks I have - quote marks are VERY sensitive!! The quote make is not ' or " it is a ` use Edit to see.
Select * from FileName
SELECT `ID` , `FirstName` , `LastName` , `email` , `phone`
FROM `JilMac`
WHERE `ID` =11
MySQL Delete Data
MySQL Upload Data
MySQL Limit Data
MySQL Insert and Insert Multiple
INSERT INTO `JilMac`
(`ID`, `FirstName`, `LastName`, `email`, `phone`)
VALUES ('14','Jil','MacMenamin','Jil.MacMenamin@ccv.edu','802-254-8628');
MySQL Update - Note use different quotes to denote ... notice how the color-coding in the query box changes!!
UPDATE `JilMac`
SET `FirstName`="Joe",`LastName`="Jones",`email`="Joe@Jones.com",`phone`="123-123-1234"
WHERE 14
Using PHPmyAdmin - Take a few Tables and EXPORT them to XML files. We will be using XML files in Assign11.
Steps:
In phpMyAdmin, Open your Database
Select the Table you want to export
Open the Table you want to create an .XML file from
Click EXPORT button at top of page
The QUICK export option will Download an XML file of the Table
Under Format - select XML
The CUSTOM export give you the option to export to Screen - so you can cut and paste
Under Format - select XML
Under Output - select View output as Text
Click GO
Copy and Paste the XML code and put it in a files - name it with a .xml extension
Use this if you are not allowed to download or have no space.
A Zipped file Chapter19-eCommerce.zip with PHP code reading ec_ tables is at the bottom of this page.
Code B+A (Plugins)
Install 3 plugin's that work with our version of PHP & MySQL
https://wordpress.org/plugins/search/php+5/
There are almost 50 pages to look through!
Post a link to the Plug-IN area on your WordPress site to your Assign13 page on ClassWeb.
Assign14
due in approx 1 week
Research - of the Students Choice that is needed for Project.
100+ Words and links to what you found useful
Add these to your Assign14 page on your Class Website
Adding a FAVICON is important to Branding your Site
Create a 2nd WordPress site https://sites.google.com/site/jilmactraining/web-app-programming/cms-wordpress under INSTRUCTIONS TO INSTALL ANOTHER WORD PRESS SITE
Add a Theme
Add a Page
Add a WordPress Photo Gallery https://sites.google.com/site/jilmactraining/web-app-programming/cms-wordpress#TOC-Adding-a-WordPress-Photo-Gallery-
Add a page and embed the form you created in Assign11
Assign13
due in approx 1 week
Research - https://wordpress.org/ and http://wordpress.com what is the difference?
What resources are available to you? Don't forget the Hartness Library's eBooks from O'Reilly
Research how programmers are using WordPress to incorporate & enhance their own developed systems
Add 100+ words and links to pages you found helpful
Add this information to your ClassWeb website for Assign13 page on ClassWeb
Also look up MINIFICATION - and why it is important to understand - and how to read it
You can manipulate a file(s) or records within a file (as well as records within a Database Table).
Examples of the types of files that are commonly manipulated are: Cookies, XML, Upload files to the server, or simply read a CVS file
FILES: Create, Read, Upload, Delete, Rename are things you can do to a FILE
Examples: Upload a file, Overwrite a file, Rename a file, Delete a file
RECORDS: CRUD=Create, Read, Update and Delete RECORDS within a file are the common ways to manipulate data in a file. (EO #6)
Examples: To keep a count of scores, how many times a user accessed something, to maintain an XML file, or update any feeder files that may configure applications, you have to manipulate it.
The reason PHP is so popular is that it is widely used for Server-Side access on the Web. It is an easy language to learn, Many of the CMS (ex. WordPress) are written with it as we have learned. Most Shared Web Hosts have PHP, MYSQL and the ability to install a CMS built in. Like our own ClassWEB which is an Amazon Shared Web Host.
Since PHP is a widely used Web language – Using FORMS to manipulate server files is common. And that is what this assignment is about. Creating a Form that interacts with a server-side file.
EXAMPLEs (which can be downloaded!) can be found on my ClassWeb page: http://jam08260.classweb.ccv.edu/AdvWD/assign11.php
ASSIGNMENT:
Research & Design a Form(s) that retrieves data from your MySQL database,.
CRUD-Create, Read, Update, Delete https://en.wikipedia.org/wiki/Create,_read,_update_and_delete
CRUD is a very common term used by developers for Files, Records within a file, Tables and Records with a Table.
This form can be incorporated into your Final Project website if you choose.
Regardless if you are creating a WordPress site - or a PHP template site.
The PHP Forms Tutorials will be helpful for understanding individual components:
PHP Form Handling https://www.w3schools.com/php/php_forms.asp
PHP Form Validation https://www.w3schools.com/php/php_form_validation.asp
PHP Form Required https://www.w3schools.com/php/php_form_required.asp
PHP Form URL/E-mail https://www.w3schools.com/php/php_form_url_email.asp
PHP Form Complete https://www.w3schools.com/php/php_form_complete.asp
AND
The PHP HOW TO section under FORMS has
Login, signup, checkout, contact, social, register, form with Icons, Newsletter, Stacked, Responsive, Popup, InLine, Clear Input, Copy Text, Animated, Search, Fullscreen, input Field, Login, Custom Checkbox/Radio, Custom, Toggle, CheckBox, Detect Caps Lock, Trigger Button, Password Validation, Tobble Password Visibility, Multiple Step and Autocomplete examples!!!
https://www.w3schools.com/howto/howto_css_login_form.asp
Storing Data in https://www.w3schools.com/xml/xml_server.asp
Code B+A
OK - now you have many examples of how you can Read and Write to an XML file Here is your BEFORE example of READING data entered into an HTML form
that updates the XML file. Upload these 3 files to your server and make sure they run correctly. Modify the .html, .php and .xml file to have two additional fields (ex. Start Year, Semester)
This would be a typical request from a customer, to add two additional fields.
FORM code - HTMLformUpdateXML - this is an HTML form http://jam08260.classweb.ccv.edu/AdvWD/Assign11/way2/HTMLformUpdateXML.html
PHP code - HTMLformUpdateXML - PHP file that takes input from the HTML form and updates XML file http://jam08260.classweb.ccv.edu/AdvWD/Assign11/way2/HTMLformUpdateXML.php
XML file http://jam08260.classweb.ccv.edu/AdvWD/Assign11/way2/studentdb.xml
Zipped File containing updateL.php and users.xml
http://jam08260.classweb.ccv.edu/AdvWD/Assign11/way2/HTMLformUpdateXML.zip
Update the form to add 2 additional fields.
Put a LINK on the FORM to Display the entire XML file you are reading.
can you incorporate this into your project?
Put a link to your form(s) OR Incorporate the Form(s) into your Assign11 page
RUBRIC https://sites.google.com/site/jilmactraining/adv-web-development/awd-Assignments#TOC-Assign11
SQL RUBRIC for Design Form assignment CommonSTEMassignment-RUBRIC.docx also Listed at bottom of the page
Export the Table and any other files you used for this assignment Assign11 folder.
Create a ZIP file in your Assign11 folder - with a link to it in on your B+A Assign11 webpage.
Sometimes you just can not find the errors. This is usually because you have not tested in small enough increments.
I call this "CODE BabySteps" because if you do too much at once - it is harder to find the error.
It is best if you START Over From Scratch - you may not believe it - but it is sometimes the fastest way.
Here I give you a Zipped file - that has
the BEFORE with 2 fields. http://jam08260.classweb.ccv.edu/AdvWD/Assign11/BabySteps/B
the AFTER only added 1 field http://jam08260.classweb.ccv.edu/AdvWD/Assign11/BabySteps/A
Using the Before & After method:
Get all the files on your server and test to make sure the programs run correctly - this is your BEFORE
Make a copy of all the files - and make a small change, Test, repeat until the code works - this is your AFTER
Continue to make small changes, test, and make another change and test.
ZIPPED file with sample Before & After http://jam08260.classweb.ccv.edu/AdvWD/Assign11/BabySteps/BabySteps.zip
Assign12
due in approx 1 week
Research WordPress Tutorials and Resource Guides. WordPress is a system. WordPress has its own Administrator panel that allows you to set up the site and add on components. Go through the Hartness Library and find me two eBooks that can help you learn the WordPress system.
Code B+A
Assign11
due in approx 1 week and it may take longer than a week.
In Advanced Web Development we learn how to use PHP to manipulate Server-Side files.(EO #4)
Code B+A - of the Students Choice that is needed for Project
Create 3 before & after examples to reinforce what you have researched.
Add these to your Assign14 page on your Class Website
Project
due Sunday at Midnight 5/16/2021
JilMac explains what the Project Overview & Project are
NOTE: this is the same video as Assign07 & Assign08: https://youtu.be/B8p2FJLJdA4
Project Rubric (how my project is graded) https://drive.google.com/file/d/1dcrx1jp7Me1gF4t8QqbBSEkRINy6FuvA/view?usp=sharing
Write the Final Project Overview for what you actually accomplished in your Project
Project = up to 25 points
Initial Project Overview = 3 points
Final Project Overview = 2 points
Total Project is worth 30% of your grade
Details for All Projects in any of JilMac's classes: https://sites.google.com/site/jilmactraining/Classes/project
=============================================================
OTHER Interesting Topics that Students can use for EXTRA CREDIT
SEO - Search Engine Optimization this is an interesting book https://www.amazon.com/WordPress-SEO-Success-Optimization-Enigine-ebook/dp/B07PF16S3L
WordPress Security https://www.codeinwp.com/blog/secure-your-wordpress-website/
https://wordpress.org/plugins/bulletproof-security/
https://www.amazon.com/dp/B01I0AX198
WordPress's Woo Commerce - the most used eCommerce component to WordPress sites has a Free LITE version to learn the ropes https://wordpress.org/plugins/woo-redsys-gateway-light/
Accessible Content - Making content accessible to those with limited sight,
or that use screen readers ... is more important now than ever
use `aria-label` to give screen readers more information than the typical "Read More" on a bloggish type of page or paragraph. Notice in this example you can SEE Read More, but the screen reader has an aria-label that gives a more in-depth description. Using this technique, these links will have context and be more informative for all users.
<a href="http://example.com" aria-label="Read more about aria-labels">Read More</a>
Back UP up your WordPress files (or any CMS, Website with Database)
Backing up your Files
Backing up a Table in your Database
Backing up your entire Database
MySQL
To delete a table or "drop" a table DROP TABLE IF EXISTS `tablename`;
Postgres vs. MySQL a comparison https://flaviocopes.com/postgres-vs-mysql/ You mean there are different types of SQL?? Yes - and many of them
From Database to Big-Data https://www.fun-mooc.fr/courses/course-v1:UCA+107004+session01/about
CRUD & CRAP - CRUD (Create, Read, Update, Delete) data – is "structured data". CRAP (Create, Replicate, Append, Process) data, can be generated by machines, large quantities at high velocity. Examples: web logs, social streams, sensor data, videos, ticker data, mobile geo-spatial, etc.
Where is their Public Data? many times you can just use a public XML file. Some examples:
https://guides.lib.umich.edu/c.php?g=283279&p=1886872
US Government Web Services and XML Data Sources http://www.usgovxml.com/
US Codes .gov https://uscode.house.gov/download/download.shtml they give you the option of XML,
NYC, NY Open Data Project: https://opendata.cityofnewyork.us
What is GitHub - https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6