Presentation is loading. Please wait.

Presentation is loading. Please wait.

Week Three CIT 354 Internet II. 2 Objectives Displaying Dynamic Content Sending E-Mail Using Your File System Common Programming Errors Summary Quiz,

Similar presentations


Presentation on theme: "Week Three CIT 354 Internet II. 2 Objectives Displaying Dynamic Content Sending E-Mail Using Your File System Common Programming Errors Summary Quiz,"— Presentation transcript:

1 Week Three CIT 354 Internet II

2 2 Objectives Displaying Dynamic Content Sending E-Mail Using Your File System Common Programming Errors Summary Quiz, Homework, and Project

3 3 Displaying Dynamic Content Displaying Browser-specific HTML Displaying Platform-specific HTML Working with String Functions Redirection to a New Location

4 4 Displaying Browser-specific HTML Differences –Microsoft Internet Explorer –Netscape Navigator Implementation –HTTP_USER_AGENT –preg_match Example: browsermatch.php (P101)

5 5 Displaying Platform-specific HTML Differences –Fonts (Times New Roman) and font size (10, 11, 12 points) –Microsoft Windows –Macintosh –Linux/UNIX Example: platformmatch.php (P 103)

6 6 Working with String Functions Creating an Input Form –Exercise generic_form.html (P107) Creating a Script to Display Form values –Exercise display_input.php (P109) Submitting your Form and Getting Results

7 7 Redirection to a New Location Creating a Redirection Form –Example: redirect_form.html (P 114) Creating the Redirection Script and testing It –Example: do_redirect.php (P 115) Submitting your Form and Getting Results

8 8 Sending E-Mail Using an SMTP Server A Simple Feedback Form A Feedback Form with Custom Error Messages

9 9 Using an SMTP Server Find an outgoing mail server –Example: smtp.com or ISP SMTP-Related Changes in php.ini –SMTP and sendmail_from

10 10 A Simple Feedback Form Creating the feedback Form –Example: simple_form.html (P 120) Creating a Script to Mail Your Form –Example: send_simpleform.php (P 122) Submitting Your Form and Getting Results

11 11 A Feedback Form with Custom Error Message Creating the Initial Script –Example: allinone_form.php (P 128) Adding Error Checking to the Script –Example: allinone_form.php (P 131) Submitting Your Form and Getting Results Saving the Values if You make an error –Example: allinone_form.php (P 138) Note: This exercise is similar to your project.

12 12 Using Your File System File Paths and Permissions Displaying Directory Contents Working with fopen() and fclose() File System Housekeeping

13 13 File Paths and Permissions For Windows, the forward slash(/) and the backslash(\) are both acceptable. For Linux/UNIX, the only forward slash is acceptable. Path Name and default drive(c:/)

14 14 Displaying Directory Contents Example: The goal is to open a directory, find the names of all the files in the directory, and print the results in a bullet list Creating the Initial Script –listfiles.php (P 143) Submitting Your Form and Getting Results

15 15 Working with fopen() and fclose() Creating a New File –Example: newfile.php (P 147) Checking If a File already Exits –Example: newfile_checkfirst.php (P 150)

16 16 Working with fopen() and fclose() Appending Data to a File Example: writedata.php (P 152) Reading Data from a File Example: readdata.php (P 155) Sending File Contents via E-Mail Example: mailcontents.php (P 157) Submitting Your Form and Getting Results

17 17 File System Housekeeping Copying Files Example: copyfile.php (P 160) Renaming Files Example: renamefile.php (P 162) Deleting Files Example: deletefile.php (P 164) Submitting Your Form and Getting Results

18 18 Common Programming Errors Omitting or incorrectly typing the opening tag <? that signifies the start of a PHP statement. Omitting or incorrectly typing the closing tag ?> that signifies the end of a PHP statement. Misspelling the name of a variable or function. Forgetting to close a string with a double quote symbol. Dividing integer values incorrectly. Forgot to use the escape (\) character. Using a variable in an expression before a value has been assigned to the variable. Incorrectly typing the letter O for the number zero (0), or vice versa. Incorrectly typing the letter l, for the number 1, or vice versa.

19 19 Chapter Summary Displaying Dynamic Content Sending E-Mail Using Your File System

20 20 Quiz, Homework, and Project Quiz 1 –Date: This Week –Contents: (Chapters 4 – 6) Homework 2 –Due Date: Next Week Project 1 –Due Date: Week 5 –Team Approach( 1 – 3 members)


Download ppt "Week Three CIT 354 Internet II. 2 Objectives Displaying Dynamic Content Sending E-Mail Using Your File System Common Programming Errors Summary Quiz,"

Similar presentations


Ads by Google