PHP: Hypertext Preprocessor. A tutorial Introduction

Similar documents
This lecture. PHP tags

Databases PHP I. (GF Royle, N Spadaccini ) PHP I 1 / 24

B. V. Patel Institute of BMC & IT 2014

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 (

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37)

PHP. Interactive Web Systems

PHP Hypertext Preprocessor

CS6501 IP Unit IV Page 1

PHP Reference. To access MySQL manually, run the following command on the machine, called Sources, where MySQL and PhP have been installed:

PHP INTERVIEW QUESTION-ANSWERS

CS 377 Database Systems. Li Xiong Department of Mathematics and Computer Science Emory University

PHP 5 Introduction. What You Should Already Know. What is PHP? What is a PHP File? What Can PHP Do? Why PHP?

Database Systems Fundamentals

CERTIFICATE IN WEB PROGRAMMING

CSCB20 Week 8. Introduction to Database and Web Application Programming. Anna Bretscher* Winter 2017

Locate your Advanced Tools and Applications

COMP284 Scripting Languages Lecture 9: PHP (Part 1) Handouts

WINTER. Web Development. Template. PHP Variables and Constants. Lecture

IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

An Introduction to JavaScript & Bootstrap Basic concept used in responsive website development Form Validation Creating templates

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web

Web Security: Vulnerabilities & Attacks

Server side basics CS380

// Introducing PHP. Overview of Dynamic Sites with PHP and Top 5 Best Practices. WebTechNY September 10 th, 2008

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley

DRACULA. CSM Turner Connor Taylor, Trevor Worth June 18th, 2015

Part I. Web Technologies for Interactive Multimedia

Development Technologies. Agenda: phpmyadmin 2/20/2016. phpmyadmin MySQLi. Before you can put your data into a table, that table should exist.

Web Scripting using PHP

Today. Review. Unix as an OS case study Intro to Shell Scripting. What is an Operating System? What are its goals? How do we evaluate it?

MySQL: Access Via PHP

Anatomy of an HTML document

Programming for the Web with PHP

Quiz 1 Review Session. November 17th, 2014

Lecture 12. PHP. cp476 PHP

JavaScript and PHP. JavaScript and PHP. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

CSC Web Programming. Introduction to JavaScript

Chapter 9 SQL in a server environment

PHP 1. Introduction Temasek Polytechnic

In addition to the primary macro syntax, the system also supports several special macro types:

COMS 469: Interactive Media II

"Charting the Course... Intermediate PHP & MySQL Course Summary

PHP Development - Introduction

A QUICK GUIDE TO PROGRAMMING FOR THE WEB. ssh (then type your UBIT password when prompted)

Personalized Movie Database System

WKA Studio for Beginners

XPath. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL.

XML Processing & Web Services. Husni Husni.trunojoyo.ac.id

PHP by Pearson Education, Inc. All Rights Reserved.

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users

this is a cat CS50 Quiz 1 Review

MYSQL DATABASE ACCESS WITH PHP

Running SQL in Java and PHP

URLs and web servers. Server side basics. URLs and web servers (cont.) URLs and web servers (cont.) Usually when you type a URL in your browser:

PHP for PL/SQL Developers. Lewis Cunningham JP Morgan Chase

What is SQL? Toolkit for this guide. Learning SQL Using phpmyadmin

Tutorials Php Y Jquery Mysql Database Without Refreshing Code

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

CSCB20 Week 8. Introduction to Database and Web Application Programming. Anna Bretscher* Winter 2016

Introduction of PHP Created By: Umar Farooque Khan

Table of Contents. Developer Manual...1

All India Council For Research & Training

What is PHP? [1] Figure 1 [1]

SQL Injection Attack Lab

Chapter 11 Outline. A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming. Slide 11-2

Introduction to Programming Using Java (98-388)

Systems Programming & Scripting

Webomania Solutions Pvt. Ltd. 2017

Running SQL in Java and PHP

Fachgebiet Technische Informatik, Joachim Zumbrägel

Such JavaScript Very Wow

Database Connectivity using PHP Some Points to Remember:

COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts

Chapter 9 SQL in a server environment

Use of PHP for DB Connection. Middle and Information Tier

PHP. How Web Applications interact with server side databases CRUD. Connecting and using mysql from PHP PHP provides many mysql specific functions

Web Scripting using PHP

Developing Online Databases and Serving Biological Research Data

Web Security, Part 1 (as usual, thanks to Dave Wagner and Vern Paxson)

Automated SQL Ownage Techniques. OWASP October 30 th, The OWASP Foundation

CMPS 401 Survey of Programming Languages

Pace University. Fundamental Concepts of CS121 1

Options. Real SQL Programming 1. Stored Procedures. Embedded SQL

Use of PHP for DB Connection. Middle and Information Tier. Middle and Information Tier

PHP. MIT 6.470, IAP 2010 Yafim Landa

Web Security. Attacks on Servers 11/6/2017 1

Manipulating Database Objects

MongoDB Web Architecture

Today's Goals. CSCI 2910 Client/Server-Side Programming. Objects in PHP. Defining a Class. Creating a New PHP Object Instance

Using PHP with MYSQL

Computer Science E-75 Building Dynamic Websites

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016

(C) Global Journal of Engineering Science and Research Management

PHP: The Basics CISC 282. October 18, Approach Thus Far

Lecture 7 PHP Basics. Web Engineering CC 552

INLS : Introduction to Information Retrieval System Design and Implementation. Fall 2008.

WKAS/PL for Beginners

Transcription:

PHP: Hypertext Preprocessor A tutorial Introduction

Introduction PHP is a server side scripting language Primarily used for generating dynamic web pages and providing rich web services PHP5 is also evolving as a robust general purpose language that suits a variety of purposes

Overview PHP for the web Dynamic content Form processing Database integration PHP on the command line Object oriented programming File handling and system functions PHP for GUI development The PHP-GTK extension

PHP on the Web

Simple Dynamic Page PHP is embedded in HTML Expressions are evaluated and HTML is returned <html> <head> </head> <body> </body> </html> <title>hello World!</title> <h1>hello World!</h1> <h2>today is <?php echo date('d-m-y');?></h2> <h2>the time is <?php echo date('h-i-s');?></h2>

Form Processing Can pass information between pages in two ways: URL Encoding ($_REQUEST and $_GET) HTTP POST Method ($_POST) URL Encoding for insecure data: www.mnit.ac.in/student.php?id=040860 POST Method for secure data: Registration forms, login forms

Database Integration - mysql Connect and authenticate to DB Send queries in SQL Parse result received Generate Output to User <?php $conn = mysql_connect('localhost', 'username', 'password'); mysql_select_db('dbname', $conn); $result = mysql_query('select * FROM student WHERE branch = CP');?>

PHP on the Command Line Very versatile and easy-to-learn language Weakly typed and hence much faster to code in Can perform a more wide variety of functions than classical languages Only disadvantage is speed, PHP is about 100 times slower than C

Variables Prefixed with a '$' sign No need to declare Boolean, Integer, Float, String Scalar Array, Object Compound Resource, NULL Special Numerous functions available for manipulation of variables Type casting, scope etc. are easier

Strings Can include variables inside strings ' used most frequently, '' used whenever there are special characters Again, over 50 string functions available <?php $x = Here's a string with a single quote ; $y = 'PHP; $z = I \n like \n $y ;?>

Arrays Can be referred by both index and key Insert delete anywhere PHP is very rich in functions, so we hardly have to write code to implement something <?php $arr = array("foo" => "bar", 12 => true); $arr[] = 'computers';?>

Variable Variables Useful concept, missing in most languages <?php $a = 'foo'; $$a = 'bar';?> Variable 'a' contains 'foo', and variable 'foo' contains 'bar', so 'echo $foo' will output 'bar'

Variable Functions Again, a very useful feature Promotes extreme generic programming and dynamism <?php func1(); $x = func2; $x();?>

Generic Functions No need for templates since PHP is weakly typed Any variable may assume any type Variable arguments possible <?php function testfunction($param1, $param2 = false) { echo $param1.$param2; }

Object Oriented Programming Very similar to the C++ design <?php class A { protected $var = Hello! ; function construct() {echo $var;} } class B extends A { function construct() {parent:: construct();} }?>

Extensions They add a lot of Value to PHP Over 100 in-built extensions, with each containing over 50 functions Some important ones include: mysql, File System, XML, IMAP/POP3, Gtk+ More feature-packed extensions available at PEAR - The PHP Extended Application Repository!

PHP-GTK 2 GUI Programming in PHP Make it very easy to design interfaces Gives the flexibility and power of PHP along with the user-friendliness of Gtk +

Sample <?php $window = new GtkWindow(); $button = new GtkButton('Click to quit'); $button->connect_simple('clicked', array('gtk', 'main_quit')); $window->set_title('php-gtk 2'); $window->add($button); $window->show_all(); Gtk::main();?>

Thank you! Powerful, Flexible, Extensive and Easy Excellent documentation and tutorials http://www.php.net/ http://gtk.php.net/ Manuals available, lots of people help anant@php.net