CSC3530 Software Technology Tutorial One Assignment overview & HTML basics
Information newsgroup: cuhk.cse.csc3530 homepage: Prof. Chiu, Dickson (SHB Rm. 912) TA (SHB Rm. 913) (SHB Rm.
Overview of assignment Individual project/assignment Web-based ordering & inventory system listing of data from database accept order from HTML form Requires HTML Perl (especially CGI & DB connectivity) SQL (insert, delete, update,…) Java (servlet & JDBC) XML
Homepage authoring assume using a CSE account create a directory www under your home directory mkdir ~/www mkdir ~/www/cgi-bin change permission to world readable chmod 711 ~/www 1 – able to read 2 – able to write 4 – able to execute use ls –l to view the permission setting For CGI application under cgi-bin directory, should be executable
Uploading HTML Connect to cugw.cse.cuhk.edu.hk Username should be Disable the passive mode
HTML basics HyperText Markup Language consist of tags and attributes e.g. …… Structure of a HTML file Title of the html file Hello World! Do you think it is boring?
Basic Tags … level n headings line break horizontal rule … start of paragraph … preformatted text (use for display codes) … defines a hyperlink load a image SRC and HREF are attribute of tags (image) and (anchor) respectively Other tags consists of attribute too, e.g. align is an attribute of
Background music Add this tag in the HEAD part <EMBED SRC=“{URL of midi file}” AUTOSTART=FALSE LOOP=FALSE WIDTH=145 HEIGHT=55> Add this tag in the BODY part This tag will show a control in the webpage..wav file also works Try the difference, if you have a poor sound card! Embed will invoke a plug-in
Frame First Frame Page Do not place tag in the body part FRAMEBORDER is an attribute, setting 0 will make the border line between frames disappear NAME is essential e.g. in the left.html, you have a hyperlink google We can change web-page of frame on the right side
Inline frame HTML 4.0 standard supported by Internet Explorer only No need to put all things in one page Usually use as a notice board Not the same as TEXTAREA tag in FORM Demo
Ordered/unordered list list item 1 list item 2 list item 3 list item 3.1 list item 3.2 Useful for displaying structured data Print a tree structure in HTML page Organizing key points list item 1 list item 2 list item 3 list item 3.1 list item 3.2
Table This is a table H1 H2 H3 A1 A2 A3 B1 B2 B3 Useful for displaying data in database For loop to display each row Good for flexible design when using border=“0” width attribute defines the dimension of the table, can be in percentage
Table (More) rowspan and colspan attribute like you use merge cell in Frontpage colspan rowspan rowspan
Form Use in CGI application Make HTML interactive One line text field Multiple line text field Checkbox Radio button Drop down menu First Second Third
Form each fields use input tag, with the type attribute different from each other except TEXTAREA and SELECT name attribute is important, better make it resonable xxx is to indicate the selected option, it will make the form more user- friendly if probably used
Form and CGI Method, either GET or POST GET will append the query string in URL../cgi-bin/getvalue.cgi?t1=what&s1=matter… GET may introduce some security problem Better use POST Action, the URL of the CGI program (may be perl, c program, servlet, ASP) Try action=“mailto:{your address} you will get a from the form Try analyse the string
Useful links HTML goodies Daves HTML Guide HTML Primer Any web page use view source Use Frontpage/ dreamweaver view the source generated
Next week PERL variables, array flow of control functions input, output