Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.

Similar presentations


Presentation on theme: "Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy."— Presentation transcript:

1 Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy

2 Agenda Rest of the year Rest of the year Presentations Presentations Error handling/Required fields Error handling/Required fields Lab Lab

3 Rest of the year Nov 7 – File I/O, image gallery Nov 7 – File I/O, image gallery Nov 14 – Presentations Due Error handling/Required fields Nov 14 – Presentations Due Error handling/Required fields Nov 21 – OPTIONAL – PHP Applications Nov 21 – OPTIONAL – PHP Applications Nov 28 – Web Service (SOAP) Nov 28 – Web Service (SOAP) Dec 5 – Object Oriented Programming & PHP Applications Dec 5 – Object Oriented Programming & PHP Applications Dec 12 – OPTIONAL – Final Project Lab Dec 12 – OPTIONAL – Final Project Lab Dec 14 – Final Projects Due Dec 14 – Final Projects Due

4 PHP & Other Applications Wordpress Wordpress MediaWIKI MediaWIKI Zen Cart Zen Cart XXAMP XXAMP Google Analytics (Tracking) Google Analytics (Tracking)

5 Form Processing HTML CLIENT: Javascript SERVER: PHP

6 Javascript function validateForm() {x=document.forms["frm"]["name"].value; if (x==null || x==""){ alert("Name must be filled out"); return false; }} http://www.w3schools.com/js/js_form_validation.asp

7 PHP Validation if (empty($_POST["name"])) { $nameErr = "Missing"; $nameErr = "Missing"; } else { $name = $_POST["name"]; } http://phpmaster.com/form-validation-with-php/

8 PHP Cleansing - FILTERS $a = 'test@example.com'; if(filter_var($a,FILTER_VALIDATE_EMAIL)) { echo 'TRUE'; } echo 'TRUE'; } else { echo 'FALSE'; } echo 'FALSE'; } $a = '<script>alert('TROUBLE');</script>'; echo filter_var($a, FILTER_SANITIZE_STRING); echo filter_var($a, FILTER_SANITIZE_STRING); http://net.tutsplus.com/tutorials/php/getting-clean-with-php/

9 PHP Cleansing - FUNCTIONS $query = ”SELECT * FROM table WHERE value=‘”. mysql_real_escape_string('$string').”‘”; $query = ”SELECT * FROM table WHERE value=‘”. mysql_real_escape_string('$string').”‘”; echo htmlspecialchars('$string'); echo htmlentities('$string');

10 Questions?

11 Quiz #2 Download the quiz from robloy.com/php Download the quiz from robloy.com/php Using the reference information, answer the question in the quiz Using the reference information, answer the question in the quiz Send the completed CODE printout to rob.loy@scottsdalecc.edu by Wednesday, Nov 28 by 6:00pm. Send the completed CODE printout to rob.loy@scottsdalecc.edu by Wednesday, Nov 28 by 6:00pm. rob.loy@scottsdalecc.edu

12 Final Project Create a PHP website using pieces of code and modules we learned in class Create a PHP website using pieces of code and modules we learned in class Make the site look like a finished product that you can share as a indication of your skills Make the site look like a finished product that you can share as a indication of your skills You will be graded on looks, details and demonstration of php knowledge You will be graded on looks, details and demonstration of php knowledge Send email to rob.loy@gmail.com with URL to input form file before 6pm on Dec 14. Send email to rob.loy@gmail.com with URL to input form file before 6pm on Dec 14.rob.loy@gmail.com


Download ppt "Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy."

Similar presentations


Ads by Google