COAP:COAP-2100/week7: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 54: Line 54:


Topics (TBA in detail)
Topics (TBA in detail)
* XML
* HTML forms processing with PHP (continued)
* SVG
 
* Document formats
* Short introduction to XML and important document standards like SVG, e-books, docx, etc.


==== Homework 7 ====
==== Homework 7 ====

Revision as of 15:58, 21 February 2011

Week 7 COAP 2100

Topics Covered

  • Web server architectures
  • Running a webserver on your own PC
  • HTML5 for information ...
  • HTML forms tutorial (continued)
  • The concept of server-side scripting and web applications

Teaching materials

Classroom activities

Monday

What do we mean by the Internet (part II - web application architectures)
Using a web server
  • Short demo of Modular Webserver System, including installation and configuration discussion
  • To start the webserver, go to the mowes directory and click mowes.exe. Make sure that no other web server is running. Also shut down applications like Skype that do grab the "webserver port".
  • Finding errors with php
    • Either look at the log file, i.e. ./apache2/logs/error.log
    • or make the following change to file ./php5/php.ini on line 538 (needs server restart):
display_errors = On
  • Web hosting (demo by a student ?) and file transfer. What's different between a web server on a PC, a web hosting provider, and a server you own.
  • If the web server or the mysql server doesn't want to start: You like have other ones running. Kill them !
  • If you see "Access denied": Go to the www directory and kill the .htacess file.
Processing forms with PHP - a few things that you should know
  • We shall make modifications to the example discussed in Processing forms with PHP
  • Make sure to understand that you must either look at log files or change the PHP configuration if you plan to develop some PHP code and deal with errors.
    • Log file location: apache2/logs/error.log
    • If you change the php.ini file or one of the options in the Mowes control panel, you will have to restart the server. Also see the access denied problem above.
  • Looking at the PHP configuration and the data that PHP will receive:
    • Insert the following line of code at the end of your PHP code: phpinfo(); and look at the PHP Variables (reload the file and then scroll down to end).
Playing with HTML and PHP
  • Make sure that the webserver and the database is started (Modular Web Server icon in the status bar)
  • Create a new quiz subdirectory under' the mowes/www directory. The web server only will serve contents from this place
  • Create two files: quiz.html and quiz-processing.php using the example code from Processing forms with PHP.
    • If you are using Kompozer: Copy/Paste into the source window. Also, you probably need Kompozer 0.8xbeta to edit the PHP file. Else just use a text editor like NoteTab.
  • Look at the files by opening the following URL: http://localhost/quiz/
  • Make changes to the HTML and PHP and reload.

Wednesday

Topics (TBA in detail)

  • HTML forms processing with PHP (continued)
  • Short introduction to XML and important document standards like SVG, e-books, docx, etc.

Homework 7

Task

Create a PHP program that can process a simple quiz made with radio buttons. In addition, it should include 1-2 text input fields that ask for a name. Start from the example presented in the HTML forms tutorial.

  • You can reuse elements from the JavaScript (hw 6) exercise. You also could relate the topic of the quiz to the term project.
  • You may use questionnaire items from other sources, but do not plagiarize. If you reuse assets from another source, cite the source. Plagiarism is simply not accepted and will be sanctioned.

Note: CS students familiar with HTML forms and PHP can use other HTML forms but be warned that, for example, processing checkboxes is more difficult.

Tips
  • Validate your HTML code
  • Use the server log files for finding PHP errors or keep the following line at the start of your PHP code:
error_reporting(E_ALL);
Evaluation criteria
  • Ergonomics and content (does the quiz "make sense" and is it interesting)
  • User experience (does it look good)
  • HTML and CSS code (is it valid)
  • Style and presentation
  • PHP (is your code running, does it compute ok)
Due
  • Before Wednesday week 8 class
Submission
  • Submit the files (*.html, *.php and if needed *.css, pictures, etc.) to the world classroom