Download: Server-side technologies. WAMP (Windows), http://www.wampserver.com/en/ MAMP (Mac), http://www.mamp.info/en/



Similar documents
A table is a collection of related data entries and it consists of columns and rows.

PHP Tutorial From beginner to master

Sample Code with Output

<head> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <title>my First PHP Lab</title> </head>

Server side scripting and databases

The following steps detail how to prepare your database.

Other Language Types CMSC 330: Organization of Programming Languages

Web Application Development

Using Cloud Databases in the Cloud Control Panel By J.R. Arredondo

SQL Injection. Blossom Hands-on exercises for computer forensics and security

Create dynamic sites with PHP & MySQL

7- PHP and MySQL queries

DIPLOMA IN WEBDEVELOPMENT

Server-side: PHP and MySQL (continued)

Supercharge your MySQL application performance with Cloud Databases

Persistent Stored Modules (Stored Procedures) : PSM

Application note: Connecting the to a Database

Mul$media im Netz (Online Mul$media) Wintersemester 2014/15. Übung 03 (Nebenfach)

SQL 2: GETTING INFORMATION INTO A DATABASE. MIS2502 Data Analytics

EMPLOYEE MANAGEMENT SYSTEM

PHP and XML. Brian J. Stafford, Mark McIntyre and Fraser Gallop

MYSQL DATABASE ACCESS WITH PHP

SQL. Short introduction

Certified PHP/MySQL Web Developer Course

Concepts Design Basics Command-line MySQL Security Loophole

INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP

Server-side scripting with PHP4

Chapter 2: Interactive Web Applications

A Brief Introduction to MySQL

LSINF1124 Projet de programmation

UQC103S1 UFCE Systems Development. uqc103s/ufce PHP-mySQL 1

Mobile Web Applications using HTML5. L. Cotfas 14 Dec. 2011

COURSE CONTENT FOR WINTER TRAINING ON Web Development using PHP & MySql

Form Handling. Server-side Web Development and Programming. Form Handling. Server Page Model. Form data appended to request string

Introduction to Server-Side Programming. Charles Liu

Web development... the server side (of the force)

José Carlos Ramalho

7 Web Databases. Access to Web Databases: Servlets, Applets. Java Server Pages PHP, PEAR. Languages: Java, PHP, Python,...

Database Management System Choices. Introduction To Database Systems CSE 373 Spring 2013

Designing for Dynamic Content

Real SQL Programming 1

Connecting to a Database Using PHP. Prof. Jim Whitehead CMPS 183, Spring 2006 May 15, 2006

Application Servers G Session 2 - Main Theme Page-Based Application Servers. Dr. Jean-Claude Franchitti

Oracle Database 10g Express

INFORMATION BROCHURE Certificate Course in Web Design Using PHP/MySQL

Short notes on webpage programming languages

Chapter 9 Java and SQL. Wang Yang wyang@njnet.edu.cn

Structured Query Language. Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics

Seamless Web Data Entry for SAS Applications D.J. Penix, Pinnacle Solutions, Indianapolis, IN

JavaScripts in HTML must be inserted between <script> and </ script> tags.

David M. Kroenke and David J. Auer Database Processing 11 th Edition Fundamentals, Design, and Implementation. Chapter Objectives

Facebook Twitter YouTube Google Plus Website

Using Database Metadata and its Semantics to Generate Automatic and Dynamic Web Entry Forms

Unified access to all your data points. with Apache MetaModel

Python and MongoDB. Why?

How To Let A Lecturer Know If Someone Is At A Lecture Or If They Are At A Guesthouse

Topic 6: Introduction to Server Side Programming with PHP/MySQL. 4 Lecture Hrs, 4 Practical Hrs. Learning Objectives

Using Python, Django and MySQL in a Database Course

Databases and SQL. The Bioinformatics Lab SS Wiki topic 10. Tikira Temu. 04. June 2013

New Features in MySQL 5.0, 5.1, and Beyond

IT3504: Web Development Techniques (Optional)

Learning MySQL! Angola Africa SELECT name, gdp/population FROM world WHERE area > !

Intro to Databases. ACM Webmonkeys 2011

Webapps Vulnerability Report

Topic 7: Back-End Form Processing and Database Publishing with PHP/MySQL

Web Development using PHP (WD_PHP) Duration 1.5 months

Database: SQL, MySQL

DFW Backup Software. Whitepaper DFW Backup Agent

Designing and Implementing an Online Bookstore Website

It is highly recommended that you are familiar with HTML and JavaScript before attempting this tutorial.

Chapter 2: Interactive Web Applications

Zoner Online Backup. Whitepaper Zoner Backup Agent

Ahsay Backup Software. Whitepaper Ahsay Backup Agent

Linas Virbalas Continuent, Inc.

LAMP [Linux. Apache. MySQL. PHP] Industrial Implementations Module Description

eattendance System for Academic Institutions

CSI 2132 Lab 3. Outline 09/02/2012. More on SQL. Destroying and Altering Relations. Exercise: DROP TABLE ALTER TABLE SELECT

Introduction to Database. Systems HANS- PETTER HALVORSEN,

Blaze Vault Online Backup. Whitepaper Blaze Vault Online Backup Agent

David M. Kroenke and David J. Auer Database Processing 12 th Edition

Welcome to CSE 330 Crea0ve Progamming and Rapid Prototyping. Course Informa0on

Web Programming Step by Step

EECS 647: Introduction to Database Systems

CSE 530A Database Management Systems. Introduction. Washington University Fall 2013

Equipment Room Database and Web-Based Inventory Management

Getting Started with MongoDB

How to Install and Setting Up Drupal

Transcription:

+ 1 Server-side technologies Apache,, Download: Apache Web Server: http://httpd.apache.org/download.cgi application server: http://www.php.net/downloads.php DBMS: http://www.mysql.com/downloads/ LAMP: is the integration of Linux, Apache, and Packages (Apache + + in a single installer): WAMP (Windows), http://www.wampserver.com/en/ / / MAMP (Mac), http://www.mamp.info/en/ 2 1

Application server Variables: $num = 58; $txt = "Hello World"; Operators: practically, the same as JavaScript (and Java, C, C++, ) Conditional constructs if (condition) ; elseif (condition) ; else ; 3 Application server Arrays: $cars = array("saab","volvo","bmw","toyota"); $cars[0]="saab"; $cars[1]="volvo"; $cars[2]="bmw"; $cars[3]="toyota"; Associative arrays: $ages = array("peter"=>32, "Quagmire"=>30, "Joe"=>34); $ages['peter'] '] = "32"; $ages['quagmire'] = "30"; $ages['joe'] = "34"; Also multidimensional 4 2

Application server Loops: while (condition) { do { while (condition); for (init; condition; increment) { foreach ($array as $value) { 5 Application server Functions: <html> <body> function add($x,$y) { $total = $x + $y; return $total; echo "1 + 16 = ". add(1,16); </body> </html> 6 3

Application server include() function:... <body> <div id="header">header page 1</div> <div id="content">content</div> <div id="menu"> include("menu.html"); </div> </body> <h2>menu</h2>... <ul> <li><a href="...">link1</a></li> <li><a href="...">link2</a></li> <li><a href="...">link3</a></li> File menu.html <li><a href="...">link4</a></li> <li><a href="...">link5</a></li> </ul> 7 Application server File management: $file = fopen("welcome.txt","r"); (r = Read only, starts at the beginning of the file; r+ = Read/Write, starts at the beginning of the file; w = write only, opens and clears the contents of file or creates a new file if it doesn't exist; w+ = read/write, opens and clears the contents of file or creates a new file if it doesn't exist; a = Append, opens and writes to the end of the file or creates a new file if it doesn't exist; a+ = Read/Append, preserves file content by writing to the end of the file; x = Write only, creates a new file, returns FALSE and an error if file already exists; x+ = Read/Write, creates a new file, returns FALSE and an error if file already exists) fclose($file); e); Row-by-row reading: while(!feof($file)) { echo fgets($file). "<br />"; 8 4

Database Opening a connection: "peter" "abc123"); if (!$con) { die('could not connect: '. mysql_error()); Closing a connection: Database creation: if (mysql_query("create DATABASE my_db",$con)) { echo "Database created"; else { echo "Error creating database: ". mysql_error(); 9 Database Table creation: CREATE TABLE table e_ name ( column_name1 data_type, column_name2 data_type, column_name3 data_type,... ) Entering data: INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...) 10 5

Database Example (table creation): p... mysql_select_db("my_db", $con); $sql = "CREATE TABLE Persons ( FirstName varchar(15), LastName varchar(15), Age int )"; // Execute query mysql_query($sql,$con); 11 Database Example (data entering): p if (!$con) { die('could not connect: '. mysql_error()); mysql_select_db("my_db", $con); mysql_query("insert INTO Persons (FirstName, LastName, Age) VALUES ('Peter', 'Griffin', '35')"); mysql_query("insert INTO Persons (FirstName, LastName, Age) VALUES ('Glenn', 'Quagmire', '33')"); 12 6

Database Example (entering data received from a form): <form action="insert.php" method="post"> Firstname: <input type="text" name="firstname" /> Lastname: <input type="text" name="lastname" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> if (!$con) { die('could not connect: '. mysql_error()); mysql _ select_ db("my y_ db", $con); $sql="insert INTO Persons (FirstName, LastName, Age) VALUES ('$_POST[firstname]','$_POST[lastname]', '$_POST[age]')"; if (!mysql_query($sql,$con)) { die('error: '. mysql_error()); mysql_close($con) 13 Database Example(Select): p if (!$con) { die('could not connect: '. mysql_error()); mysql_select_db("my_db", $con); $result = mysql_query("select * FROM Persons"); while($row = mysql_fetch_array($result)) { echo $row['firstname']. " ". $row['lastname']; echo "<br />"; 14 7