Open Source Programming 1 PHP Introduction to PHP

  • Slides: 35
Download presentation
Open Source Programming 1

Open Source Programming 1

PHP - Introduction to PHP - PHP installation /wamp server installation for PHP environment

PHP - Introduction to PHP - PHP installation /wamp server installation for PHP environment - PHP syntax - PHP variables - PHP Strings - PHP Operator

The Objectives: • To be employable … or – to become an employer/entrepreneur 3

The Objectives: • To be employable … or – to become an employer/entrepreneur 3

The Objectives: • To be employable … or – to become an employer/entrepreneur •

The Objectives: • To be employable … or – to become an employer/entrepreneur • OSP objectives: • Students need specific technical skills! • Students need to know Programming! • Students need to know teamwork • Students must be problem-solvers. 4

The Prerequisites: • if u know HTML then ok else no problem You need

The Prerequisites: • if u know HTML then ok else no problem You need courage and time • This will be an Intense course 5

What’s the course? • Programming in PHP + my. SQL • “But. . .

What’s the course? • Programming in PHP + my. SQL • “But. . . I’m not a programmer!” Right. That’s why you are here. When we are done, you WILL be a programmer. 6

The Goals: • Problem-solving and debugging • PHP language • my. SQL database design

The Goals: • Problem-solving and debugging • PHP language • my. SQL database design and language • Improve your HTML skills • Understand use XML 7

What you’ll learn Server-side scripting – PHP Form processing Cookies + Validation + Regular

What you’ll learn Server-side scripting – PHP Form processing Cookies + Validation + Regular Expressions Sessions + Authentication File processing Image libraries + APIs Relational databases / My. SQL Simple. XML Objects + Classes Security 8

Expectations and Performance Sound in programming NOT ANY MORE. If you don’t work hard

Expectations and Performance Sound in programming NOT ANY MORE. If you don’t work hard in this course, 9

Computing Environment: • Dreamweaver MX 2004 or better edits PHP very nicely (Or: Free:

Computing Environment: • Dreamweaver MX 2004 or better edits PHP very nicely (Or: Free: Notepad++, Codelobster. . . ) WAMP: Windows-Apache, My. SQL, PHP MAMP: Macintosh-Apache, My. SQL, PHP We demonstrate today, help you install. www. wampserver. com www. mamp. info 10

Two Tier Web Architecture: Client: e. g. Fire. Fox On your PC Request: HTTP

Two Tier Web Architecture: Client: e. g. Fire. Fox On your PC Request: HTTP Web Server: e. g. Apache On sulley. dm. ucf. edu 11

Two Tier Web Architecture: Client: e. g. Fire. Fox On your PC Request: HTTP

Two Tier Web Architecture: Client: e. g. Fire. Fox On your PC Request: HTTP . html Files Web Server: e. g. Apache On sulley. dm. ucf. edu 12

Two Tier Web Architecture: HTML Client: e. g. Fire. Fox On your PC Request:

Two Tier Web Architecture: HTML Client: e. g. Fire. Fox On your PC Request: HTTP . html files Web Server: e. g. Apache On sulley. dm. ucf. edu Response: HTTP/HTML (or other doctypes: PDF, etc) (client doesn’t see PHP) 13

Two Tier Web Architecture: Client: e. g. Fire. Fox On your PC PHP Request:

Two Tier Web Architecture: Client: e. g. Fire. Fox On your PC PHP Request: HTTP Web Server: e. g. Apache On sulley. dm. ucf. edu Response: HTTP/HTML (or other doctypes: PDF, etc) (client doesn’t see PHP) . php files help Apache CREATE html Tagged data 14

Three Tier Web Architecture: My. SQL Client: e. g. Fire. Fox On your PC

Three Tier Web Architecture: My. SQL Client: e. g. Fire. Fox On your PC Request: HTTP Web Server: e. g. Apache On sulley. dm. ucf. edu Response: HTTP/HTML (or other doctypes: PDF, etc) (client doesn’t see PHP) . php files ask My. SQL For info; put into HTML form Request: SQL Database Mgt System: My. SQL Reply: ASCII. frm, . MYD, . MYI files 15

Three Tier Web Architecture: My. SQL Client: e. g. Fire. Fox On your PC

Three Tier Web Architecture: My. SQL Client: e. g. Fire. Fox On your PC Request: HTTP Web Server: e. g. Apache On sulley. dm. ucf. edu Response: HTML (client doesn’t see PHP) Examples (what they call for: ) Customer: - Shopping Cart DB Administrator: - PHPmy. Admin Managers, etc: - Specialized PHP code . php files ask My. SQL For info; put into HTML form Request: SQL Database Mgt System: My. SQL Reply: ASCII. frm, . MYD, . MYI files 16

WAMP

WAMP

What is WAMP? • WAMP = Windows+Apache+My. Sql+PHP Note: WAMP 5 does not work

What is WAMP? • WAMP = Windows+Apache+My. Sql+PHP Note: WAMP 5 does not work with Windows 98, Me

WAMP Installation • A single installation file downloaded from http: //www. wampserver. com/en/download. php

WAMP Installation • A single installation file downloaded from http: //www. wampserver. com/en/download. php

After Installation Application Service • Apache wampapache • PHP • My. SQL database wampmysql

After Installation Application Service • Apache wampapache • PHP • My. SQL database wampmysql

WAMP’s Menu Management Portals • PHPmyadmin • SQLitemanager Note: A user has to click

WAMP’s Menu Management Portals • PHPmyadmin • SQLitemanager Note: A user has to click on the icon tray to access WAMP's menu.

WAMP’s Menu • Configuration and Settings • Loaded Modules • Directory Access Shortcut

WAMP’s Menu • Configuration and Settings • Loaded Modules • Directory Access Shortcut

WAMP’s Menu Services • Apache • My. SQL Note: The icon tray reflects the

WAMP’s Menu Services • Apache • My. SQL Note: The icon tray reflects the status of your server.

Haiti Migration Architecture

Haiti Migration Architecture

Haiti Migration New Applications • Apache HTTPS Setting • My. SQL – DDL –

Haiti Migration New Applications • Apache HTTPS Setting • My. SQL – DDL – DML – Data Migration

Haiti Migration • DDL For example, Ms. SQL: CREATE TABLE <TABLENAME> ( <TABLENAME>_id bigint

Haiti Migration • DDL For example, Ms. SQL: CREATE TABLE <TABLENAME> ( <TABLENAME>_id bigint IDENTITY (1, 1) NOT NULL … My. SQL: CREATE TABLE <TABLENAME> ( <TABLENAME>_id bigint NOT NULL AUTO_INCREMENT, …

Haiti Migration • DML For example, Ms. SQL: select top 10 * from patient;

Haiti Migration • DML For example, Ms. SQL: select top 10 * from patient; My. SQL: select * from patient limit 0, 10;

Haiti Migration • Data Ms. SQL: My. SQL:

Haiti Migration • Data Ms. SQL: My. SQL:

Haiti Migration • Data Migration We use ODBC to migrate data from the Ms.

Haiti Migration • Data Migration We use ODBC to migrate data from the Ms. SQL database to the My. SQL database. We use PHP to export data from the My. SQL database and then import the data into the My. SQL database.

Haiti Migration • Ms. SQL and My. SQL follow the SQL-92 standard. However, each

Haiti Migration • Ms. SQL and My. SQL follow the SQL-92 standard. However, each of them have their own extensions. Source Common Full Name Development Method ANSI SQL/PSM SQL/Persistent Stored Module Standard IBM SQL PL SQL Procedural Language Proprietary Microsoft/ T-SQL Transact-SQL Proprietary My. SQL Sybase My. SQL Open Source/ Proprietary Oracle PL/SQL Procedural Language/SQL Proprietary

Affected Applications • Question Which applications will be affected if we install WAMP?

Affected Applications • Question Which applications will be affected if we install WAMP?

Affected Applications • PERL(Replication) • PHP • Tomcat

Affected Applications • PERL(Replication) • PHP • Tomcat

Affected Applications • PERL (Replication) It uses standard sql in inserting data. Conclusion: It

Affected Applications • PERL (Replication) It uses standard sql in inserting data. Conclusion: It requires a little change during the WAMP migration.

Overall • WAMP is easy to install and it is free to use. •

Overall • WAMP is easy to install and it is free to use. • Migration from IIS/PHP/Ms. SQL to WAMP is practical. • The cost of migration is mainly to review queries and change them based on the SQL extension of My. SQL.

FOR next week, WHAT? what you SHOULD have done. If you are fine, If

FOR next week, WHAT? what you SHOULD have done. If you are fine, If MAC, find and install MAMP Else If Win, find and install WAMP Else you're Linux, and cool already. MAMP: Macintosh Apache, My. SQL, PHP www. mamp. info WAMP: you get the picture. www. wampserver. com 35