CIS166AE : PHP Web Scripting Rob Loy. Tonight’s Agenda Housekeeping items Housekeeping items PHP basics PHP basics Student connection to server Student.

Slides:



Advertisements
Similar presentations
WordPress Installation for Beginners Sheila Bergman
Advertisements

Cookies, Sessions. Server Side Includes You can insert the content of one file into another file before the server executes it, with the require() function.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
CPSC 203 Introduction to Computers Tutorial 59 & 64 By Jie (Jeff) Gao.

Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
PHP Scripts HTML Forms Two-tier Software Architecture PHP Tools.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
ALBERT WAVERING BOBBY SENG. Week Whatever: PHP  Announcements/questions/complaints.
CSC 318 WEB APPLICATION DEVELOPMENT.  Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function.
PHP HYPERTEXT: PREPROCESSOR By: Justin T. Pleva. WHAT IS PHP?  General purpose  Server-side web development  Console application.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Web Administration.
Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
CPSC 203 Introduction to Computers Lab 21, 22 By Jie Gao.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
INTERNET APPLICATION DEVELOPMENT For More visit:
CPSC203 Introduction to Computers Lab 69 By Jie Gao.
SYST Web Technologies SYST Web Technologies Lesson 6 – Intro to JavaScript.
Week 9 PHP Cookies and Session Introduction to JavaScript.
A little PHP. Enter the simple HTML code seen below.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
CPSC 203 Introduction to Computers Lab 23 By Jie Gao.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Overview: 1. Discussion of the basic architecture of a web application. 2. Discussion of the relevance of using MySQL and PHP in a web application.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports.
Introduction to Web Programming. Introduction to PHP What is PHP? What is a PHP File? What is MySQL? Why PHP? Where to Start?
CIS133: Internet Development Week 2. Agenda  Homework Review  MYSCC  FTP  HTML Code  In-class  Lab / Homework.
1 Session 1: Introduction to PHP & MySQL iNET Academy Open Source Web Development.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
IT ELECTIVE 2.  Web server Can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver content that.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
U:/msu/course/cse/103 Day 21, Slide 1 CSE 103 Makeups –If you didn’t take one over the weekend, take one TUESDAY or WEDNESDAY!
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Chap 2 – Getting Started COMP YL Professor Mattos.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
PHP Form Processing * referenced from
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
CGS 3066: Web Programming and Design Spring 2016 PHP.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
A pache M ySQL P hp Robert Mudge Reference:
PHP using MySQL Database for Web Development (part II)
Introduction to Dynamic Web Programming
Active Server Pages Computer Science 40S.
PHP / MySQL Introduction
PHP Introduction.
Web Systems Development (CSC-215)
PHP and Forms.
Tutorial 6 PHP & MySQL Li Xu
PHP Forms and Databases.
PHP an introduction.
PHP By Prof. B.A.Khivsara Note: The material to prepare this presentation has been taken from internet and are generated only for students reference and.
Presentation transcript:

CIS166AE : PHP Web Scripting Rob Loy

Tonight’s Agenda Housekeeping items Housekeeping items PHP basics PHP basics Student connection to server Student connection to server In-class work In-class work

Class Logistics Dates: Sept 5 to Dec 12 Dates: Sept 5 to Dec 12 Time: Wednesday 6:00 - 9:50pm (Lab time included in class time) Time: Wednesday 6:00 - 9:50pm (Lab time included in class time) Room: CM 447 Room: CM 447 Section: Section: 36721

Class Structure Review of homework and lab Review of homework and lab Any quizzes or presentations Any quizzes or presentations Lecture/new materials Lecture/new materials In-class (hands on) work In-class (hands on) work Lab work Lab work

Class Contact Web Content: Web Content: 1: 1: 2: 2: Phone: Phone: Send to BOTH s for faster response

Eclipse with PHP Eclipse with PHP Filezilla Filezilla Internet Explorer Internet Explorer Phpmyadmin (SQL) Phpmyadmin (SQL) mySCC mySCC SCC Class Folders “CIS-166/” SCC Class Folders “CIS-166/” Class Tools

Understand basic HTML Understand basic HTML Do not need to know programming logic Do not need to know programming logic All assignments will be attempted even if not completed to get a “C” All assignments will be attempted even if not completed to get a “C” Some assignments will require work OUTSIDE the class room Some assignments will require work OUTSIDE the class room Student Expectations

Expected Knowledge Basic HTML Code Basic HTML Code Right+click menus Right+click menus Shortcuts (Copy/Paste etc.) Shortcuts (Copy/Paste etc.) Folder structures Folder structures

Class Standards Lower-case, alphanumeric filenames Lower-case, alphanumeric filenames Homework submitted by 6:00pm next class Homework submitted by 6:00pm next class All links ed to working page on the site All links ed to working page on the site New folder created each week New folder created each week Lab time is optional, but lab assignment MUST be completed Lab time is optional, but lab assignment MUST be completed

PHP Basics PHP Basics PHP Functions PHP Functions PHP Object Orientated Programming (OOP) PHP Object Orientated Programming (OOP) PHP/mySQL Databases PHP/mySQL Databases PHP Module Creation PHP Module Creation PHP Applications PHP Applications Semester Agenda

Open Source Environment L INUX: Operating system for server L INUX: Operating system for server A pache: Web server for server A pache: Web server for server M ySQL: DB application for server M ySQL: DB application for server P HP: programming language P HP: programming language XXAMP: Windows complete Apache, PHP and mySQL environment XXAMP: Windows complete Apache, PHP and mySQL environment

PHP Environment Filename extensions has to be.php Filename extensions has to be.php Requests from the user goes to an Apache Web Server Requests from the user goes to an Apache Web Server Server processes all programming and returns HTML to client (browser) Server processes all programming and returns HTML to client (browser) Any storage is usually in a database on the server side Any storage is usually in a database on the server side

PHP Basics Environment Environment Variable Variable Constants Constants Arrays Arrays Code branching Code branching Loops Loops

PHP Functions PHP Built-in functions PHP Built-in functions User created functions User created functions Parameters Parameters Scope Scope

PHP OOP Object Oriented Programming (OOP) Object Oriented Programming (OOP) Class creation Class creation Object creation Object creation OOP Methods OOP Methods

PHP/mySQL DB Databases 101 Databases 101 phpmyadmin phpmyadmin SQL SELECT SQL SELECT SQL INSERT SQL INSERT SQL UPDATE SQL UPDATE

User Created Modules Web contact page Web contact page Newsletter sign-up Newsletter sign-up Secured pages Secured pages Image gallery Image gallery Facebook application Facebook application Mobile application (web service) Mobile application (web service)

PHP Applications WordPress WordPress OSCommerce OSCommerce Drupal Drupal Any other PHP applications? Any other PHP applications?

Student Connection Domain: Domain: FTP URL:.com FTP URL:.com Username: springscc Username: springscc Password: Password: Directory: Directory: mySQL Admin: mysql..com mySQL Admin: mysql..com

acrossthemiddle<01>akbarcommand<02>bowlofmarbles<03>credass<04>designporch<05>druidtemple<06>fadedhistory<07>frinkster<08>fumbledball<09>galaxyclass<10>kneescrape<12>loyalpenguin<13>nimbledesigns<14>poorchimp<15>rancidcheese<16>reekingonion<17>rockinggranny<18>rustednails<19>sharperthoughts<20>shouldabeen<21>slantroute<22>sometimeswhen<23>squishybread<24>swezzer<25>weekoldbread<26>wipedmemory<27>zourn<28> Domains for Class

PHP Coding Terms Whitespace does not impact results Whitespace does not impact results { } = braces / curlies { } = braces / curlies () = parenthesis () = parenthesis ; = semicolon ; = semicolon \ = back slash \ = back slash / = forward clash / = forward clash

PHP Operators - Math + - Addition + - Addition - - Subtraction - - Subtraction * - Multiplication * - Multiplication / - Division / - Division % - Modulus (division remainder) % - Modulus (division remainder) ++ - Incement Incement Decrement – Decrement – 1. - String addition (e.g 1.1 = 11). - String addition (e.g 1.1 = 11)

PHP Operators - Comparison < - Less than < - Less than > - Greater than > - Greater than <> - Not equal <> - Not equal == - Equals == - Equals !- NOT (e.g. !== means NOT equal) !- NOT (e.g. !== means NOT equal)

Basic PHP Code Syntax : contains PHP code for the server to translate : contains PHP code for the server to translate //: php comments //: php comments echo $a;: prints the item or variable to the screen echo $a;: prints the item or variable to the screen print($a);: prints the item or variable to the screen print($a);: prints the item or variable to the screen All statements end with a semicolon All statements end with a semicolon

PHP Variables Variables are represented by a dollar sign followed by the name of the variable. Variables are represented by a dollar sign followed by the name of the variable. Not tied to a specific type of variable like Java,.NET. Not tied to a specific type of variable like Java,.NET. A variable name can only contain alpha-numeric characters and underscores A variable name can only contain alpha-numeric characters and underscores Variable name is case-sensitive. Variable name is case-sensitive. Examples: $cost, $obj_name Examples: $cost, $obj_name Syntax: $cost = 4.12, $obj_name = “bike” Syntax: $cost = 4.12, $obj_name = “bike”

PHP Arrays Variable capable of holding more than one value in a single reference variable Variable capable of holding more than one value in a single reference variable Content held in a Key / Value config Content held in a Key / Value config Examples: $month[] Examples: $month[] Syntax set-up: $month = array(“Jan”,”Feb”,“Mar”,“Apr”); Syntax set-up: $month = array(“Jan”,”Feb”,“Mar”,“Apr”); Syntax look-up: echo $month[2]; $month = array(“Jan”,”Feb”,“Mar”,“Apr”); Syntax look-up: echo $month[2]; $month = array(“Jan”,”Feb”,“Mar”,“Apr”);

PHP Constants A constant cannot change value A constant cannot change value A constant is case-sensitive by default A constant is case-sensitive by default Constant identifiers are uppercase Constant identifiers are uppercase Examples: COST, UNIT_TAX Examples: COST, UNIT_TAX Syntax: DEFINE (COST, 4.12) DEFINE (OBJ_NAME, “My bicycle”); Syntax: DEFINE (COST, 4.12) DEFINE (OBJ_NAME, “My bicycle”);

PHP & HTML (1) <?php $a = “John”; ?><html><body> Hello Hello </body></html>

PHP & HTML (2) <?php $a = “John”; echo “ \n”; echo “ echo “ echo “ Hello “. $john. “ \n”; echo “ \n”; ?>

IMPORTANT NOTE Eclipse is part of MySCC Eclipse is part of MySCC Filezilla is part of MySCC Filezilla is part of MySCC You can NOT use MySCC Filezilla in class You can NOT use MySCC Filezilla in class For each class, download Filezilla and install on the desktop! For each class, download Filezilla and install on the desktop!

In Class Work

FTP (Filezilla) Connect to remote server using credentials Connect to remote server using credentials Click files and then click: Click files and then click: GET file FROM remote server GET file FROM remote server PUT files ON to remote server PUT files ON to remote server Drag files to move files Drag files to move files Can also RIGHT CLICK to see more options Can also RIGHT CLICK to see more options

Editing (Notepad) Open Notepad Open Notepad Save file as index.php Save file as index.php You can use any text editor You can use any text editor

HTML Form Syntax Form method: How the information goes. Form method: How the information goes. GET = in the URL string GET = in the URL string POST = in HTTP Header (preferred) POST = in HTTP Header (preferred) Form action: Where the information goes. Form action: Where the information goes. Input name: How the information is stored (“variable” name) Input name: How the information is stored (“variable” name)

PHP & HTML Forms </form> <?php echo “ Name is “.$_POST[“fred”].“ \n”; ?> form.php form.html

Previewing Work Use any browser Use any browser Navigate to the URL and the folder/file name (reminder case-sensitive) Navigate to the URL and the folder/file name (reminder case-sensitive) Might have to click F5 to refresh pages Might have to click F5 to refresh pages Check HTML -> View Source Check HTML -> View Source

Next Week Programming basic Programming basic User Functions User Functions PHP Functions PHP Functions Eclipse (IDE) Eclipse (IDE)

Homework/Lab 1) Send me an with your domain name you picked in class 1) Send me an with your domain name you picked in class 2) Send me an with the link to the work we did in class in a folder called “homework1”. The homework should be accessible at the following URL: 2) Send me an with the link to the work we did in class in a folder called “homework1”. The homework should be accessible at the following URL: