1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP...

35
1 Open Source Programming

Transcript of 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP...

Page 1: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

1

Open Source Programming

Page 2: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

- Introduction to PHP- PHP installation /wamp server

installation for PHP environment- PHP syntax- PHP variables- PHP Strings- PHP Operator

PHP

Page 3: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

3

The Objectives:

• To be employable …

or – to become an employer/entrepreneur

Page 4: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

4

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.

Page 5: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

5

The Prerequisites:

• if u know HTML then ok else no problem

You need courage and time

• This will be an Intense course

Page 6: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

6

What’s the course?

• Programming in PHP + mySQL

• “But ... I’m not a programmer!”

Right. That’s why you are here.

When we are done, you WILL be

a programmer.

Page 7: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

7

The Goals:

• Problem-solving and debugging

• PHP language

• mySQL database design and language

• Improve your HTML skills

• Understand and use XML

Page 8: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

8

What you’ll learnServer-side scripting – PHP

Form processing

Cookies + Validation + Regular Expressions

Sessions + Authentication

File processing

Image libraries + APIs

Relational databases / MySQL

SimpleXML

Objects + Classes

Security

Page 9: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

9

Expectations and Performance

Sound in programming

NOT ANY MORE.

If you don’t work hard in this course,

Page 10: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

10

Computing Environment:

•Dreamweaver MX 2004 or better

edits PHP very nicely

(Or: Free: Notepad++, Codelobster...)

WAMP: Windows-Apache, MySQL, PHP

MAMP: Macintosh-Apache, MySQL, PHP

We demonstrate today, help you install.

www.wampserver.com

www.mamp.info

Page 11: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

11

Two Tier Web Architecture:

Client:e. g. FireFoxOn your PC

Web Server:e. g. ApacheOn sulley.dm.ucf.edu

Request: HTTP

Page 12: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

12

Two Tier Web Architecture:

Client:e. g. FireFoxOn your PC

Web Server:e. g. ApacheOn sulley.dm.ucf.edu

Request: HTTP .htmlFiles

Page 13: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

13

Two Tier Web Architecture:HTML

Client:e. g. FireFoxOn your PC

Web Server:e. g. ApacheOn sulley.dm.ucf.edu

Request: HTTP .htmlfiles

Response: HTTP/HTML(or other doctypes:PDF,etc)(client doesn’t see PHP)

Page 14: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

14

Two Tier Web Architecture: PHP

Client:e. g. FireFoxOn your PC

Web Server:e. g. ApacheOn sulley.dm.ucf.edu

Request: HTTP

.php files help ApacheCREATE htmlTagged data

Response: HTTP/HTML(or other doctypes:PDF,etc)(client doesn’t see PHP)

Page 15: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

15

Three Tier Web Architecture:MySQL

Client:e. g. FireFoxOn your PC

Web Server:e. g. ApacheOn sulley.dm.ucf.edu

Request: HTTP

Response: HTTP/HTML(or other doctypes:PDF,etc)(client doesn’t see PHP)

.php files ask MySQLFor info; put into HTML form

DatabaseMgt System:MySQL

Request:SQL

Reply:ASCII

.frm, .MYD,

.MYI files

Page 16: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

16

Three Tier Web Architecture:MySQL

Client:e. g. FireFoxOn your PC

Web Server:e. g. ApacheOn sulley.dm.ucf.edu

Request: HTTP

Response: HTML(client doesn’t see PHP) .php files ask MySQL

For info; put into HTML form

DatabaseMgt System:MySQL

Request:SQL

Reply:ASCII

.frm, .MYD,

.MYI files

Examples (what they call for:)Customer:

- Shopping CartDB Administrator:

- PHPmyAdminManagers,etc:

- Specialized PHP code

Page 17: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

WAMP

Page 18: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

What is WAMP?

• WAMP = Windows+Apache+MySql+PHP

Note:WAMP5 does not work with Windows 98,Me

Page 19: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

WAMP Installation

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

Page 20: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

After Installation

Application Service

• Apache

wampapache

• PHP

• MySQL database

wampmysql

Page 21: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

WAMP’s Menu

Management Portals

• PHPmyadmin

• SQLitemanager

Note: A user has to click

on the icon tray to access WAMP's menu.

Page 22: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

WAMP’s Menu

• Configuration and

Settings

• Loaded Modules

• Directory Access Shortcut

Page 23: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

WAMP’s Menu

Services

• Apache

• MySQL

Note:

The icon tray reflects the status of your server.

Page 24: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Haiti MigrationArchitecture

Windows Server

IIS

LDAPPHP

SQL Server

Tomcat

Perl (Replication)

Login/offReport

Windows Server

Apache

LDAPPHP

MySQL

Tomcat

Perl (Replication)

Login/offReport

Page 25: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Haiti Migration

New Applications• Apache HTTPS Setting• MySQL

– DDL– DML– Data– Data Migration

Page 26: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Haiti Migration

• DDLFor example, MsSQL:

CREATE TABLE <TABLENAME> (<TABLENAME>_id bigint IDENTITY (1, 1) NOT NULL

MySQL:CREATE TABLE <TABLENAME> (

<TABLENAME>_id bigint NOT NULL AUTO_INCREMENT,

Page 27: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Haiti Migration

• DML

For example,

MsSQL:select top 10 * from patient;

MySQL:select * from patient limit 0,10;

Page 28: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Haiti Migration

• Data

MsSQL:

MySQL:

Page 29: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Haiti Migration

• Data Migration

We use ODBC to migrate data from the MsSQL database to the MySQL database.

We use PHP to export data from the MySQL database and then import the data into the MySQL database.

Page 30: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Haiti Migration

• MsSQL and MySQL follow the SQL-92 standard. However, each of them have their own extensions.

Source Common Full Name Development

  Name   Method

ANSI SQL/PSM SQL/Persistent Stored Module Standard

IBM SQL PL SQL Procedural Language Proprietary

Microsoft/ T-SQL Transact-SQL Proprietary

Sybase      

MySQL MySQL MySQL Open Source/

      Proprietary

Oracle PL/SQL Procedural Language/SQL Proprietary

Page 31: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Affected Applications

• QuestionWhich applications will be affected if we install

WAMP?

Windows Server

Apache

LDAPPHP

MySQL

Tomcat

Perl (Replication)

Login/offReport

Windows Server

Apache

LDAPPHP

MySQL

Tomcat

Perl (Replication)

Login/offReport

Page 32: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Affected Applications

• PERL(Replication)

• PHP

• Tomcat

Page 33: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Affected Applications

• PERL (Replication)

It uses standard sql in inserting data.

Conclusion: It requires a little change during the WAMP migration.

Page 34: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

Overall

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

• Migration from IIS/PHP/MsSQL to WAMP is practical.

• The cost of migration is mainly to review queries and change them based on the SQL extension of MySQL.

Page 35: 1 Open Source Programming. -Introduction to PHP -PHP installation /wamp server installation for PHP environment -PHP syntax -PHP variables -PHP Strings.

3535353535

FOR next week, WHAT?

what you SHOULD have done.

If you are fine,If MAC, find and install MAMP

ElseIf Win, find and install WAMPElse

you're Linux, and cool already.MAMP: Macintosh Apache, MySQL, PHP

www.mamp.infoWAMP: you get the picture.

www.wampserver.com