Website Development - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Website Development

Description:

guestbook.html. personal.html /chapter4. errorscript.php . . . firstscript.php. phptag.php ... Never error free. Updates hard to manage. Instead, use server ... – PowerPoint PPT presentation

Number of Views:1088
Avg rating:3.0/5.0
Slides: 14
Provided by: Econ82
Category:

less

Transcript and Presenter's Notes

Title: Website Development


1
Website Development Management
CIT 3353 -- Fall 2005 www.clt.astate.edu/jseydel/m
is3353
  • Form Processing with PHP

Instructor John Seydel, Ph.D.
2
Todays Agenda
  • Discuss Exam 1
  • Summarize and review recent material
  • Discuss file and applications management
  • Introduce server-side includes
  • Note AITP meeting (whats AITP?)

3
Information about Exam 1
  • Meet in BU 205
  • Closed book / closed notes
  • Exam will be available Monday _at_ 500 pm
  • Primarily coding
  • Specifications given
  • HTML and PHP code to be written accordingly
  • Bring pencils and erasers
  • What to expect
  • HTML (Chapters 1-3, 6)
  • XHTML 1.0
  • Basics elements/tags/attributes,
  • Style rules
  • Forms
  • PHP (through Chapter 5 helpful to take a look at
    Chapter 6 also)
  • Basics variables, functions
  • Form processing
  • Server setup/organization/administration

4
Recall Browser/Server Interaction
5
How Forms Work
  • Form data
  • Using post (see example) data in body
  • Using get (see example) data in querystring
  • Lets look at a response header
  • Linking a form and its handler
  • In the ltformgt tag, specify the action attribute
  • When the submit button is clicked, the data are
    sent to the form handler

6
Form Validation
  • Necessary for any real application
  • Avoids GIGO syndrome
  • Done
  • At the client with JavaScript
  • On the server with PHP (or whatever system is in
    place)
  • Which is better . . . ?
  • Refer to the example (compound_proc.php)
  • Note the condition in the if statement
  • Note the redirection that takes place
  • Redirection
  • When change of control requires another file
  • Often used when website is moved
  • How header(Location . . . )

7
Style Rule Concepts
  • Based on the CSS language specified so far using
    the style attribute
  • Facilitate separating structure, semantics, and
    display
  • Syntax
  • Always property1valueproperty2value . . .
  • Example font-size10pttext-alignjustify
  • Properties you should be able to modify by now
  • color
  • background-image
  • font-size
  • text-align
  • font-style

8
Some Miscellaneous Things
  • Error in calculation on compound_proc.php
  • No one noticed!
  • Clearly results in unreasonable result
  • Application management involves simultaneously
    running multiple applications
  • PHP Designer edit locally
  • ID (viewing localhost) view pages/applications
    on development server
  • Windows Explorer copy file from local machine
  • IE (running FTP) paste (i.e., upload) to SuSE1
  • IE (viewing SuSE1 through HTTP) view
    pages/applications on production server
  • Anything else . . . ?

9
File Management
  • Mirror your files use the same directory
    structure for
  • Local machine
  • My Documents root
  • Localhost root
  • SuSE1 server
  • Portable disk (e.g., jump drive)
  • Structure
  • index.html
  • exercises.html
  • . . .
  • /images
  • LogoASU.gif
  • . . .
  • /exercises
  • guestbook.html
  • personal.html
  • . . .
  • /chapter4
  • errorscript.php . . .

10
Server-Side Includes
  • Note some components used throughout multiple
    pages (e.g., headers and footers)
  • CIT 3353 website
  • Suzy Student website
  • CIT website
  • ASU website
  • Why write the code for these components over and
    over?
  • Takes time
  • Never error free
  • Updates hard to manage
  • Instead, use server-side includes
  • See reference section of PHP textbook (page
  • Example include(header.shtml)
  • Try it!

11
Appendix
12
Some Guidelines for Source Code
  • Use lowercase for tags attributes
  • Quote attribute values
  • Use relative references for resources on same
    server
  • Always use closing tags
  • Nest elements properly close in reverse order of
    opening
  • Use indentation consistently and to make code
    readable
  • No more than 80 characters per line of code
    break long tags into multiple lines, typically
    one per attribute
  • Avoid deprecated elements, e.g., ltfontgt, ltigt, ltbgt
  • Use no spaces in file names
  • Treat all URLs and other resource names as if
    case-sensitive

13
Setup for Today
  • Login using your student ID
  • Open Windows Explorer
  • Click on Folders button
  • Folders view on left
  • Contents pane on right
  • Navigate to \htdocs directory (localhost root)
  • See if you can copy any file into \htdocs
  • Open PHP Designer close all window except Task
    Panel
  • Open IE (2 instances)
  • One starting in localhost
  • Use the other to FTP to your home directory on
    SuSE1
  • All applications should be opened to partial
    windows that can be cascaded
Write a Comment
User Comments (0)
About PowerShow.com