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

Post on 24-Dec-2015

289 views 6 download

Tags:

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

1

Open Source Programming

- Introduction to PHP- PHP installation /wamp server

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

PHP

3

The Objectives:

• To be employable …

or – to become an employer/entrepreneur

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.

5

The Prerequisites:

• if u know HTML then ok else no problem

You need courage and time

• This will be an Intense course

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.

7

The Goals:

• Problem-solving and debugging

• PHP language

• mySQL database design and language

• Improve your HTML skills

• Understand and use XML

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

9

Expectations and Performance

Sound in programming

NOT ANY MORE.

If you don’t work hard in this course,

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

11

Two Tier Web Architecture:

Client:e. g. FireFoxOn your PC

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

Request: HTTP

12

Two Tier Web Architecture:

Client:e. g. FireFoxOn your PC

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

Request: HTTP .htmlFiles

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)

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)

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

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

WAMP

What is WAMP?

• WAMP = Windows+Apache+MySql+PHP

Note:WAMP5 does not work with Windows 98,Me

WAMP Installation

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

After Installation

Application Service

• Apache

wampapache

• PHP

• MySQL database

wampmysql

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

Services

• Apache

• MySQL

Note:

The icon tray reflects the status of your server.

Haiti MigrationArchitecture

Windows Server

IIS

LDAPPHP

SQL Server

Tomcat

Perl (Replication)

Login/offReport

Windows Server

Apache

LDAPPHP

MySQL

Tomcat

Perl (Replication)

Login/offReport

Haiti Migration

New Applications• Apache HTTPS Setting• MySQL

– DDL– DML– Data– Data Migration

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,

Haiti Migration

• DML

For example,

MsSQL:select top 10 * from patient;

MySQL:select * from patient limit 0,10;

Haiti Migration

• Data

MsSQL:

MySQL:

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.

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

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

Affected Applications

• PERL(Replication)

• PHP

• Tomcat

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.

• 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.

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