php Mr. Amit Patel Hypertext Preprocessor Dept. of I.T.

Size: px
Start display at page:

Download "php Mr. Amit Patel Hypertext Preprocessor Dept. of I.T."

Transcription

1 php Hypertext Preprocessor Mr. Amit Patel Dept. of I.T..com.com

2 PHP files can contain text, HTML, JavaScript code, and PHP code PHP code are executed on the server, and the result is returned to the browser as plain HTML What is a PHP File? PHP files have a default file extension of ".php".com

3 What Can PHP Do? PHP can generate dynamic page content. PHP can create, open, read, write, and close files on the server. PHP can collect form data. PHP can send and receive cookies. PHP can add, delete, modify data in your database. PHP can restrict users to access some pages on your website. PHP can encrypt data. With PHP you are not limited to output HTML. You can output images, PDF files, and even Flash movies. You can also output any text, such as XHTML and XML..com

4 Why PHP? PHP runs on different platforms (Windows, Linux, Unix, Mac OS X, etc.) PHP is compatible with almost all servers used today (Apache, IIS, etc.) PHP has support for a wide range of databases PHP is free. Download it from the official PHP resource: PHP is easy to learn and runs efficiently on the server side.com

5 <html> <body> <h1>my first PHP page</h1> <?php echo Welcome Alpha!";?> </body> </html> Basic PHP Syntax A PHP script starts with <?php and ends with?>:.com

6 <!DOCTYPE html> <html> <body> Comment in PHP <?php //This is a PHP comment line /* This isa PHP comment block*/?> </body> </html>.com

7 Rules for Variables in PHP As with algebra, PHP variables can be used to hold values (x=5) or expressions (z=x+y). Variable can have short names (like x and y) or more descriptive names (age, carname, totalvolume). Rules for PHP variables: A variable starts with the $ sign, followed by the name of the variable A variable name must begin with a letter or the underscore character A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ) A variable name should not contain spaces Variable names are case sensitive ($y and $Y are two different variables).com

8 <?php $x=5; $y=6; $z=$x+$y; echo $z;?> x=5 y=6 z=x+y Variables in PHP In algebra we use letters (like x) to hold values (like 5). From the expression z=x+y above, we can calculate the value of z to be 11. In PHP these letters are called VARIABLES..com

9 PHP is a Loosely Typed Language $txt="hello world!"; $x=5; PHP automatically converts the variable to the correct data type, depending on its value. In a strongly typed programming language, we will have to declare (define) the type and name of the variable before using it..com

10 PHP Variable Scopes PHP has four different variable scopes: Local scope Global scope Static scope Parameter scope.com

11 <?php $x=5; // global scope Local Scopes function mytest() echo $x; // local scope mytest(); echo $x;?>.com

12 Global Scopes <?php $x=5; // global scope $y=10; // global scope function mytest() global $x,$y; $y=$x+$y; mytest(); echo $y; // output is 15?>.com

13 <?php function mytest() static $x=0; echo $x; $x++; mytest(); mytest(); mytest();?> Static Scopes.com

14 <?php function mytest($x) echo $x; mytest(5);?> Parameter Scopes A parameter is a local variable whose value is passed to the function by the calling code. Parameters are declared in a parameter list as part of the function declaration:.com

15 String Variables in PHP String variables are used for values that contain characters. After we have created a string variable we can manipulate it. A string can be used directly in a function or it can be stored in a variable. In the example below, we create a string variable called txt, then we assign the text "Hello world!" to it. Then we write the value of the txt variable to the output: <?php $txt="hello world!"; echo $txt;?>.com

16 Concatenation String Operators There is only one string operator in PHP. The concatenation operator [. ] is used to join two string values together. <?php $txt1="hello world!"; $txt2="what a nice day!"; echo $txt1. " ". $txt2;?>.com

17 PHP strlen() function Sometimes it is useful to know the length of a string value. The strlen() function returns the length of a string, in characters. <?php echo strlen("hello world!");?>.com

18 PHP strpos() function The strpos() function is used to search for a character or a specific text within a string. If a match is found, it will return the character position of the first match. If no match is found, it will return FALSE. <?php echo strpos("hello world!","world");?>.com

19 PHP Date() function <?php print( Today s Date is.date( l F d, y ));?>.com

20 PHP Arithmetic Operators.com

21 PHP Assignment Operators The basic assignment operator in PHP is "=". It means that the left operand gets set to the value of the expression on the right. That is, the value of "$x = 5" is 5..com

22 PHP Incr/Decr Operators.com

23 PHP Comparison Operators.com

24 PHP Logical Operators.com

25 PHP Array Operators.com

26 PHP If Statements SYNTAX: if (condition) code to be executed if condition is true; <?php $t=date("h"); if ($t<"20") echo "Have a good day!";?>.com

27 SYNTAX: PHP If Else Statements if (condition) code to be executed if condition is true; else code to be executed if condition is false;.com

28 PHP If Else Statements (cont ) <?php $t=date("h"); if ($t<"20") echo "Have a good day!"; else echo "Have a good night!";?>.com

29 SYNTAX: PHP If Else If Else Statements if (condition) code to be executed if condition is true; else if (condition) code to be executed if condition is true; else code to be executed if condition is false;.com

30 PHP If Else If Else Statements (cont ) <?php $t=date("h"); if ($t<"10") echo "Have a good morning!"; else if ($t<"20") echo "Have a good day!"; else echo "Have a good night!";?>.com

31 SYNTAX: PHP Switch Case Statements switch (n) case label1: code to be executed if n=label1; break; case label2: code to be executed if n=label2; break; default: code to be executed if n is different from both label1 and label2;.com

32 PHP Switch Case Statements <?php $favcolor="red"; switch ($favcolor) case "red": echo "Your favorite color is red! ; break; case "blue": echo "Your favorite color is blue! ; break; case "green": echo "Your favorite color is green! ; break; default: echo "Your favorite color is None of them!";?>.com

33 PHP Arrays An array is a special variable, which can hold more than one value at a time. If you have a list of items (a list of car names, for example), storing the cars in single variables could look like this: $cars1="volvo"; $cars2="bmw"; $cars3="toyota"; An array can hold many values under a single name, and you can access the values by referring to an index number..com

34 Creating a php Arrays PHP Arrays In PHP, the array() function is used to create an array: Types of php Arrays In PHP, there are three types of arrays: Indexed arrays - Arrays with numeric index Associative arrays - Arrays with named keys Multidimensional arrays - Arrays containing one or more arrays.com

35 PHP Indexed Arrays There are two ways to create indexed arrays: The index can be assigned automatically (index always starts at 0): $cars=array("volvo","bmw","toyota"); The index can be assigned manually: $cars[0]="volvo"; $cars[1]="bmw"; $cars[2]="toyota"; <?php $cars=array("volvo","bmw","toyota"); echo "I like ". $cars[0]. ", ". $cars[1]. " and ". $cars[2]. ".";?>.com

36 PHP Associative Arrays Associative arrays are arrays that use named keys that you assign to them. There are two ways to create an associative array: $age=array("peter"=>"35","ben"=>"37","joe"=>"43"); $age['peter']="35"; $age['ben']="37"; $age['joe']="43"; <?php $age=array("peter"=>"35","ben"=>"37","joe"=>"43"); echo "Peter is ". $age['peter']. " years old.";?>.com

37 What is MySQL? PHP Database Connectivity MySQL is a database system used on the web MySQL is a database system that runs on a server MySQL is ideal for both small and large applications MySQL is very fast, reliable, and easy to use MySQL supports standard SQL MySQL compiles on a number of platforms MySQL is free to download and use MySQL is developed, distributed, and supported by Oracle Corporation MySQL is named after co-founder Monty Widenius's daughter: My.com

38 Open a Connection to the MySQL Server Before we can access data in a database, we must open a connection to the MySQL server. In PHP, this is done with the mysqli_connect() function. Syntax PHP Database Connectivity mysqli_connect(host,username,password,dbname);.com

39 PHP Database Connectivity.com

40 PHP Database Connectivity Open a Connection to the MySQL Server <?php // Create connection $con=mysqli_connect( localhost, root, ", temp ); // Check connection if (mysqli_connect_errno($con)) echo "Failed to connect to MySQL: ". mysqli_connect_error();?>.com

41 PHP Database Connectivity Close a Connection to the MySQL Server <?php $con=mysqli_connect( localhost", root,, temp ); // Check connection if (mysqli_connect_errno($con)) echo "Failed to connect to MySQL: ". mysqli_connect_error(); mysqli_close($con);?>.com

42 PHP Database Connectivity Create a Database <?php $con=mysqli_connect( localhost, root, abc123 ); // Check connection if (mysqli_connect_errno()) echo "Failed to connect to MySQL: ". mysqli_connect_error(); // Create database $sql="create DATABASE temp"; if (mysqli_query($con,$sql)) echo "Database my_db created successfully"; else echo "Error creating database: ". mysqli_error();?>.com

43 Create a Table PHP Database <?php $con=mysqli_connect( localhost","peter","", temp"); // Check connection if (mysqli_connect_errno()) echo "Failed to connect to MySQL: ". mysqli_connect_error();.com

44 PHP Database // Create table $sql="create TABLE persons(firstname CHAR(30),Lastname CHAR(30),Age INT)"; // Execute query if (mysqli_query($con,$sql)) echo "Table persons created successfully"; else echo "Error creating table: ". mysqli_error();?>.com

45 Primary Keys and Auto Increment Fields PHP Database Each table in a database should have a primary key field. The following example sets the PID field as the primary key field. The primary key field is often an ID number, and is often used with the AUTO_INCREMENT setting. AUTO_INCREMENT automatically increases the value of the field by 1 each time a new record is added. To ensure that the primary key field cannot be null, we must add the NOT NULL setting to the field: $sql = "CREATE TABLE Persons ( PID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(PID), Firstname CHAR(15), Lastname CHAR(15), Age INT(3) )";.com

46 Inserting Data into the Table PHP Database <?php $con=mysqli_connect( localhost", root,, temp"); // Check connection if (mysqli_connect_errno()) echo "Failed to connect to MySQL: ". mysqli_connect_error(); mysqli_query($con,"insert INTO Persons (FirstName, LastName, Age)VALUES ('Peter', 'Griffin',35)"); mysqli_query($con,"insert INTO Persons (FirstName, LastName, Age) VALUES ('Glenn', 'Quagmire',33)"); mysqli_close($con);?>.com

47 Yet I will Not Consider this Presentation 100%. New Topic will be added at the end of the Slide after the Mid Sem Examination. By Mr. Amit Patel.com

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

What is PHP? [1] Figure 1 [1] PHP What is PHP? [1] PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on the server PHP is free to download and use Figure

More information

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

PHP 5 Introduction. What You Should Already Know. What is PHP? What is a PHP File? What Can PHP Do? Why PHP? PHP 5 Introduction What You Should Already Know you should have a basic understanding of the following: HTML CSS What is PHP? PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open

More information

Princess Nourah bint Abdulrahman University. Computer Sciences Department

Princess Nourah bint Abdulrahman University. Computer Sciences Department Princess Nourah bint Abdulrahman University Computer Sciences Department 1 And use http://www.w3schools.com/ PHP Part 1 Objectives Introduction to PHP Computer Sciences Department 4 Introduction HTML CSS

More information

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

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT. Chapter 7:- PHP Compiled By:- Assistant Professor, SVBIT. Outline Starting to script on server side, Arrays, Function and forms, Advance PHP Databases:-Basic command with PHP examples, Connection to server,

More information

Web Engineering (Lecture 08) WAMP

Web Engineering (Lecture 08) WAMP Web Engineering (Lecture 08) WAMP By: Mr. Sadiq Shah Lecturer (CS) Class BS(IT)-6 th semester WAMP WAMP is all-in-one Apache/MySQL/PHP package WAMP stands for: i) Windows ii) iii) iv) Apache MySql PHP

More information

PHP Introduction. Some info on MySQL which we will cover in the next workshop...

PHP Introduction. Some info on MySQL which we will cover in the next workshop... PHP and MYSQL PHP Introduction PHP is a recursive acronym for PHP: Hypertext Preprocessor -- It is a widely-used open source general-purpose serverside scripting language that is especially suited for

More information

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

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Introduction: PHP (Hypertext Preprocessor) was invented by Rasmus Lerdorf in 1994. First it was known as Personal Home Page. Later

More information

PHP by Pearson Education, Inc. All Rights Reserved.

PHP by Pearson Education, Inc. All Rights Reserved. PHP 1992-2012 by Pearson Education, Inc. All Client-side Languages User-agent (web browser) requests a web page JavaScript is executed on PC http request Can affect the Browser and the page itself http

More information

Part 3: Online Social Networks

Part 3: Online Social Networks 1 Part 3: Online Social Networks Today's plan Project 2 Questions? 2 Social networking services Social communities Bebo, MySpace, Facebook, etc. Content sharing YouTube, Flickr, MSN Soapbox, etc. Corporate

More information

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

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users Introduction to PHP Let's Look Back We talked about how to create a form in HTML Forms are one way to interact with users Users can enter information into forms which can be used by you (programmer) We

More information

AN INTRODUCTION TO WEB PROGRAMMING. Dr. Hossein Hakimzadeh Department of Computer and Information Sciences Indiana University South Bend, IN

AN INTRODUCTION TO WEB PROGRAMMING. Dr. Hossein Hakimzadeh Department of Computer and Information Sciences Indiana University South Bend, IN AN INTRODUCTION TO WEB PROGRAMMING Dr. Hossein Hakimzadeh Department of Computer and Information Sciences Indiana University South Bend, IN HISTORY Developed by Michael Widenius. Initially release in 1995.

More information

Unit IV- Server Side Technologies (PHP)

Unit IV- Server Side Technologies (PHP) Web Technology Unit IV- Server Side Technologies (PHP) By Prof. B.A.Khivsara Note: The material to prepare this presentation has been taken from internet and are generated only for students reference and

More information

SEEM4570 System Design and Implementation. Lecture 6 Game Part II

SEEM4570 System Design and Implementation. Lecture 6 Game Part II SEEM4570 System Design and Implementation Lecture 6 Game Part II Preparation We continue the code in the last lecture (Lecture 06). 2017 Gabriel Fung 2 Programming with Client-Server System In practice,

More information

INTERNET PROGRAMMING. Software Engineering Branch / 4 th Class Computer Engineering Department University of Technology

INTERNET PROGRAMMING. Software Engineering Branch / 4 th Class Computer Engineering Department University of Technology INTERNET PROGRAMMING Software Engineering Branch / 4 th Class Computer Engineering Department University of Technology OUTLINES PHP Basic 2 ARCHITECTURE OF INTERNET database mysql server-side programming

More information

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

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Web programming The PHP language Our objective Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Access data inserted by users into HTML forms Interact

More information

Princess Nourah bint Abdulrahman University. Computer Sciences Department

Princess Nourah bint Abdulrahman University. Computer Sciences Department Princess Nourah bint Abdulrahman University 1 And use http://www.w3schools.com/ JavaScript Objectives Introduction to JavaScript Objects Data Variables Operators Types Functions Events 4 Why Study JavaScript?

More information

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:

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: URLs and web servers 2 1 Server side basics http://server/path/file Usually when you type a URL in your browser: Your computer looks up the server's IP address using DNS Your browser connects to that IP

More information

PHP. M hiwa ahamad aziz Raparin univercity. 1 Web Design: Lecturer ( m hiwa ahmad aziz)

PHP. M hiwa ahamad aziz  Raparin univercity. 1 Web Design: Lecturer ( m hiwa ahmad aziz) PHP M hiwa ahamad aziz www.raparinweb.com Raparin univercity 1 Server-Side Programming language asp, asp.net, php, jsp, perl, cgi... 2 Of 68 Client-Side Scripting versus Server-Side Scripting Client-side

More information

CSC Web Programming. Introduction to JavaScript

CSC Web Programming. Introduction to JavaScript CSC 242 - Web Programming Introduction to JavaScript JavaScript JavaScript is a client-side scripting language the code is executed by the web browser JavaScript is an embedded language it relies on its

More information

Server side basics CS380

Server side basics CS380 1 Server side basics URLs and web servers 2 http://server/path/file Usually when you type a URL in your browser: Your computer looks up the server's IP address using DNS Your browser connects to that IP

More information

PHP Development - Introduction

PHP Development - Introduction PHP Development - Introduction Php Hypertext Processor PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports many

More information

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

IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population In this lab, your objective is to learn the basics of creating and managing a DB system. One way to interact with the DBMS (MySQL)

More information

Introduction of PHP Created By: Umar Farooque Khan

Introduction of PHP Created By: Umar Farooque Khan 1 Introduction of PHP Created By: Umar Farooque Khan 2 What is PHP? PHP stand for hypertext pre-processor. PHP is a general purpose server side scripting language that is basically used for web development.

More information

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

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL. Hello everyone! Welcome to our PHP + MySQL (Easy to learn) E.T.L. free online course Hope you have installed your XAMPP? And you have created your forms inside the studio file in the htdocs folder using

More information

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script What is Java Script? CMPT 165: Java Script Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University November 7, 2011 JavaScript was designed to add interactivity to HTML pages

More information

Lecture 12. PHP. cp476 PHP

Lecture 12. PHP. cp476 PHP Lecture 12. PHP 1. Origins of PHP 2. Overview of PHP 3. General Syntactic Characteristics 4. Primitives, Operations, and Expressions 5. Control Statements 6. Arrays 7. User-Defined Functions 8. Objects

More information

PHP. Introduction. PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server

PHP. Introduction. PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP Introduction Hypertext Preprocessor is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages. For this purpose, PHP code is

More information

Web Programming. Dr Walid M. Aly. Lecture 10 PHP. lec10. Web Programming CS433/CS614 22:32. Dr Walid M. Aly

Web Programming. Dr Walid M. Aly. Lecture 10 PHP. lec10. Web Programming CS433/CS614 22:32. Dr Walid M. Aly Web Programming Lecture 10 PHP 1 Purpose of Server-Side Scripting database access Web page can serve as front-end to a database Ømake requests from browser, Øpassed on to Web server, Øcalls a program to

More information

Important Points about PHP:

Important Points about PHP: Important Points about PHP: PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking,

More information

MULTIMEDIA AND WEB TECHNOLOGY

MULTIMEDIA AND WEB TECHNOLOGY SET 4 Series : GBM/1 Code No. 89/1 Roll No. Candidates must write the Code on the title page of the answer-book. Please check that this question paper contains 08 printed pages. Code number given on the

More information

Web Engineering (Lecture 09) PHP part I

Web Engineering (Lecture 09) PHP part I Web Engineering (Lecture 09) PHP part I By: Mr. Sadiq Shah Lecturer (CS) Class BS(IT)-6 th semester PHP Data Types Variables can store data of different types, and different data types can do different

More information

3 The Building Blocks: Data Types, Literals, and Variables

3 The Building Blocks: Data Types, Literals, and Variables chapter 3 The Building Blocks: Data Types, Literals, and Variables 3.1 Data Types A program can do many things, including calculations, sorting names, preparing phone lists, displaying images, validating

More information

Lecture 7 PHP Basics. Web Engineering CC 552

Lecture 7 PHP Basics. Web Engineering CC 552 Lecture 7 PHP Basics Web Engineering CC 552 Overview n Overview of PHP n Syntactic Characteristics n Primitives n Output n Control statements n Arrays n Functions n WampServer Origins and uses of PHP n

More information

PHP BASICS BY ALL-TECH SYSTEMS & CO

PHP BASICS BY ALL-TECH SYSTEMS & CO LET S GET STARTED PHP BASICS BY PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. To start with PHP, you must have an idea about the following 1. HTML

More information

PHP 1. Introduction Temasek Polytechnic

PHP 1. Introduction Temasek Polytechnic PHP 1 Introduction Temasek Polytechnic Background Open Source Apache License Free to redistribute with/without source code http://www.apache.org/license.txt Backed by Zend Corporation http://www.zend.com

More information

Getting started 7. Performing operations 25

Getting started 7. Performing operations 25 Contents Contents 1 2 3 Getting started 7 Introducing PHP & MySQL 8 Understanding the cloud 9 Installing Abyss Web Server 10 Installing the PHP engine 12 Configuring Abyss for PHP 14 Embedding PHP script

More information

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

CS 377 Database Systems. Li Xiong Department of Mathematics and Computer Science Emory University CS 377 Database Systems Database Programming in PHP Li Xiong Department of Mathematics and Computer Science Emory University Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP

More information

MULTIMEDIA AND WEB TECHNOLOGY

MULTIMEDIA AND WEB TECHNOLOGY SET-4 Series GBM Code No. 89 Roll No. Candidates must write the Code on the title page of the answer-book. Please check that this question paper contains 9 printed pages. Code number given on the right

More information

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

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 ( Course Title PHP ( Level 1 ( Course Description PHP '' Hypertext Preprocessor" is the most famous server-side programming language in the world. It is used to create a dynamic website and it supports many

More information

PHP INTERVIEW QUESTION-ANSWERS

PHP INTERVIEW QUESTION-ANSWERS 1. What is PHP? PHP (recursive acronym for PHP: Hypertext Preprocessor) is the most widely used open source scripting language, majorly used for web-development and application development and can be embedded

More information

Chapter 13 : Informatics Practices. Class XI ( As per CBSE Board) SQL Commands. New Syllabus Visit : python.mykvs.in for regular updates

Chapter 13 : Informatics Practices. Class XI ( As per CBSE Board) SQL Commands. New Syllabus Visit : python.mykvs.in for regular updates Chapter 13 : Informatics Practices Class XI ( As per CBSE Board) SQL Commands New Syllabus 2018-19 SQL SQL is an acronym of Structured Query Language.It is a standard language developed and used for accessing

More information

What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity]

What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity] What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity] MySQL is a database. A database defines a structure for storing information. In a database, there are tables. Just

More information

Web Scripting using PHP

Web Scripting using PHP Web Scripting using PHP Server side scripting No Scripting example - how it works... User on a machine somewhere Server machine So what is a Server Side Scripting Language? Programming language code embedded

More information

Database Connectivity using PHP Some Points to Remember:

Database Connectivity using PHP Some Points to Remember: Database Connectivity using PHP Some Points to Remember: 1. PHP has a boolean datatype which can have 2 values: true or false. However, in PHP, the number 0 (zero) is also considered as equivalent to False.

More information

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

CSCB20 Week 8. Introduction to Database and Web Application Programming. Anna Bretscher* Winter 2017 CSCB20 Week 8 Introduction to Database and Web Application Programming Anna Bretscher* Winter 2017 *thanks to Alan Rosselet for providing the slides these are adapted from. Web Programming We have seen

More information

PHP. Interactive Web Systems

PHP. Interactive Web Systems PHP Interactive Web Systems PHP PHP is an open-source server side scripting language. PHP stands for PHP: Hypertext Preprocessor One of the most popular server side languages Second most popular on GitHub

More information

Programming for the Web with PHP

Programming for the Web with PHP Aptech Ltd Version 1.0 Page 1 of 11 Table of Contents Aptech Ltd Version 1.0 Page 2 of 11 Abstraction Anonymous Class Apache Arithmetic Operators Array Array Identifier arsort Function Assignment Operators

More information

JavaScript s role on the Web

JavaScript s role on the Web Chris Panayiotou JavaScript s role on the Web JavaScript Programming Language Developed by Netscape for use in Navigator Web Browsers Purpose make web pages (documents) more dynamic and interactive Change

More information

PHP 5 if...else...elseif Statements

PHP 5 if...else...elseif Statements PHP 5 if...else...elseif Statements Conditional statements are used to perform different actions based on different conditions. PHP Conditional Statements Very often when you write code, you want to perform

More information

C++ Programming: From Problem Analysis to Program Design, Third Edition

C++ Programming: From Problem Analysis to Program Design, Third Edition C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 2: Basic Elements of C++ Objectives (continued) Become familiar with the use of increment and decrement operators Examine

More information

Web Systems Nov. 2, 2017

Web Systems Nov. 2, 2017 Web Systems Nov. 2, 2017 Topics of Discussion Using MySQL as a Calculator Command Line: Create a Database, a Table, Insert Values into Table, Query Database Using PhP API to Interact with MySQL o Check_connection.php

More information

JavaScript CS 4640 Programming Languages for Web Applications

JavaScript CS 4640 Programming Languages for Web Applications JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation

More information

LECTURE 02 INTRODUCTION TO C++

LECTURE 02 INTRODUCTION TO C++ PowerPoint Slides adapted from *Starting Out with C++: From Control Structures through Objects, 7/E* by *Tony Gaddis* Copyright 2012 Pearson Education Inc. COMPUTER PROGRAMMING LECTURE 02 INTRODUCTION

More information

Server side basics CSC 210

Server side basics CSC 210 1 Server side basics Be careful 2 Do not type any command starting with sudo into a terminal attached to a university computer. You have complete control over you AWS server, just as you have complete

More information

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley PHP and MySQL for Dynamic Web Sites Intro Ed Crowley Class Preparation If you haven t already, download the sample scripts from: http://www.larryullman.com/books/phpand-mysql-for-dynamic-web-sitesvisual-quickpro-guide-4thedition/#downloads

More information

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

Web Application Development (WAD) V th Sem BBAITM (Unit 4) By: Binit Patel Web Application Development (WAD) V th Sem BBAITM (Unit 4) By: Binit Patel Working with Forms: A very popular way to make a web site interactive is using HTML based forms by the site. Using HTML forms,

More information

CS6501 IP Unit IV Page 1

CS6501 IP Unit IV Page 1 CS6501 Internet Programming Unit IV Part - A 1. What is PHP? PHP - Hypertext Preprocessor -one of the most popular server-side scripting languages for creating dynamic Web pages. - an open-source technology

More information

SQL Commands & Mongo DB New Syllabus

SQL Commands & Mongo DB New Syllabus Chapter 15 : Computer Science Class XI ( As per CBSE Board) SQL Commands & Mongo DB New Syllabus 2018-19 SQL SQL is an acronym of Structured Query Language.It is a standard language developed and used

More information

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

More information

Setting Up a Development Server What Is a WAMP, MAMP, or LAMP? Installing a WAMP on Windows Testing the InstallationAlternative WAMPs Installing a

Setting Up a Development Server What Is a WAMP, MAMP, or LAMP? Installing a WAMP on Windows Testing the InstallationAlternative WAMPs Installing a Setting Up a Development Server What Is a WAMP, MAMP, or LAMP? Installing a WAMP on Windows Testing the InstallationAlternative WAMPs Installing a LAMP on Linux Working Remotely Introduction to web programming

More information

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017) COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017) RAMANA ISUKAPALLI RAMANA@CS.COLUMBIA.EDU 1 LECTURE-1 Course overview See http://www.cs.columbia.edu/~ramana Overview of HTML Formatting, headings,

More information

JavaScript CS 4640 Programming Languages for Web Applications

JavaScript CS 4640 Programming Languages for Web Applications JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation

More information

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

In addition to the primary macro syntax, the system also supports several special macro types: The system identifies macros using special parentheses. You need to enclose macro expressions into curly brackets and the percentage symbol: {% expression %} Kentico provides an object-oriented language

More information

An introduction for the novice. David Lawrence, JLab. 5/8/07 MySQL David Lawrence 1/36

An introduction for the novice. David Lawrence, JLab. 5/8/07 MySQL David Lawrence 1/36 An introduction for the novice David Lawrence, JLab 5/8/07 MySQL David Lawrence 1/36 What is a Database? Store information(data) in a reliable, accessible way Allow access to data over a network to multiple

More information

B. V. Patel Institute of BMC & IT 2014

B. V. Patel Institute of BMC & IT 2014 Unit 1: Introduction Short Questions: 1. What are the rules for writing PHP code block? 2. Explain comments in your program. What is the purpose of comments in your program. 3. How to declare and use constants

More information

DevShala Technologies A-51, Sector 64 Noida, Uttar Pradesh PIN Contact us

DevShala Technologies A-51, Sector 64 Noida, Uttar Pradesh PIN Contact us INTRODUCING PHP The origin of PHP PHP for Web Development & Web Applications PHP History Features of PHP How PHP works with the Web Server What is SERVER & how it works What is ZEND Engine Work of ZEND

More information

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

COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

Course Topics. The Three-Tier Architecture. Example 1: Airline reservations. IT360: Applied Database Systems. Introduction to PHP

Course Topics. The Three-Tier Architecture. Example 1: Airline reservations. IT360: Applied Database Systems. Introduction to PHP Course Topics IT360: Applied Database Systems Introduction to PHP Database design Relational model SQL Normalization PHP MySQL Database administration Transaction Processing Data Storage and Indexing The

More information

Basic PHP. Lecture 19. Robb T. Koether. Hampden-Sydney College. Mon, Feb 26, 2108

Basic PHP. Lecture 19. Robb T. Koether. Hampden-Sydney College. Mon, Feb 26, 2108 Basic PHP Lecture 19 Robb T. Koether Hampden-Sydney College Mon, Feb 26, 2108 Robb T. Koether (Hampden-Sydney College) Basic PHP Mon, Feb 26, 2108 1 / 27 1 PHP 2 The echo Statement 3 Variables 4 Operators

More information

DR B.R.AMBEDKAR UNIVERSITY B.Sc.(Computer Science): III Year THEORY PAPER IV (Elective 4) PHP, MySQL and Apache

DR B.R.AMBEDKAR UNIVERSITY B.Sc.(Computer Science): III Year THEORY PAPER IV (Elective 4) PHP, MySQL and Apache DR B.R.AMBEDKAR UNIVERSITY B.Sc.(Computer Science): III Year THEORY PAPER IV (Elective 4) PHP, MySQL and Apache 90 hrs (3 hrs/ week) Unit-1 : Installing and Configuring MySQL, Apache and PHP 20 hrs Installing

More information

Core PHP. PHP output mechanism. Introducing. Language basics. Installing & Configuring PHP. Introducing of PHP keywords. Operators & expressions

Core PHP. PHP output mechanism. Introducing. Language basics. Installing & Configuring PHP. Introducing of PHP keywords. Operators & expressions Core PHP Introducing The origin of PHP PHP for web Development & Web Application PHP History Features of PHP How PHP works with the server What is server & how it works Installing & Configuring PHP PHP

More information

Database Management Systems,

Database Management Systems, Database Management Systems SQL Query Language (1) 1 Topics Introduction SQL History Domain Definition Elementary Domains User-defined Domains Creating Tables Constraint Definition INSERT Query SELECT

More information

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS313D: ADVANCED PROGRAMMING LANGUAGE CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 2 : C# Language Basics Lecture Contents 2 The C# language First program Variables and constants Input/output Expressions and casting

More information

CMPS 401 Survey of Programming Languages

CMPS 401 Survey of Programming Languages CMPS 401 Survey of Programming Languages Programming Assignment #4 PHP Language On the Ubuntu Operating System Write a PHP program (P4.php) and create a HTML (P4.html) page under the Ubuntu operating system.

More information

CGS 3066: Spring 2015 JavaScript Reference

CGS 3066: Spring 2015 JavaScript Reference CGS 3066: Spring 2015 JavaScript Reference Can also be used as a study guide. Only covers topics discussed in class. 1 Introduction JavaScript is a scripting language produced by Netscape for use within

More information

Databases on the web

Databases on the web Databases on the web The Web Application Stack Network Server You The Web Application Stack Network Server You The Web Application Stack Web Browser Network Server You The Web Application Stack Web Browser

More information

ISSN: [Kumar * et al., 7(3): March, 2018] Impact Factor: 5.164

ISSN: [Kumar * et al., 7(3): March, 2018] Impact Factor: 5.164 IJESRT INTERNATIONAL JOURNAL OF ENGINEERING SCIENCES & RESEARCH TECHNOLOGY DEVELOPMENT OF A SMALL FOSS APPLICATION NAMED TEACHER STUDENT PORTAL USING FREE AND OPEN SOURCE SOFTWARES Sushil Kumar *1, Dr.

More information

CISC 1600 Lecture 2.4 Introduction to JavaScript

CISC 1600 Lecture 2.4 Introduction to JavaScript CISC 1600 Lecture 2.4 Introduction to JavaScript Topics: Javascript overview The DOM Variables and objects Selection and Repetition Functions A simple animation What is JavaScript? JavaScript is not Java

More information

Chapter 1 An introduction to relational databases and SQL

Chapter 1 An introduction to relational databases and SQL Chapter 1 An introduction to relational databases and SQL Murach's MySQL, C1 2015, Mike Murach & Associates, Inc. Slide 1 Objectives Knowledge Identify the three main hardware components of a client/server

More information

BASIC ELEMENTS OF A COMPUTER PROGRAM

BASIC ELEMENTS OF A COMPUTER PROGRAM BASIC ELEMENTS OF A COMPUTER PROGRAM CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING LOGO Contents 1 Identifier 2 3 Rules for naming and declaring data variables Basic data types 4 Arithmetic operators

More information

PHP Hypertext Preprocessor

PHP Hypertext Preprocessor PHP Hypertext Preprocessor A brief survey Stefano Fontanelli stefano.fontanelli@sssup.it January 16, 2009 Stefano Fontanelli stefano.fontanelli@sssup.it PHP Hypertext Preprocessor January 16, 2009 1 /

More information

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010 CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011 Lectures 1-22 Moaaz Siddiq Asad Ali Latest Mcqs MIDTERM EXAMINATION Spring 2010 Question No: 1 ( Marks: 1 ) - Please

More information

tablename ORDER BY column ASC tablename ORDER BY column DESC sortingorder, } The WHERE and ORDER BY clauses can be combined in one

tablename ORDER BY column ASC tablename ORDER BY column DESC sortingorder, } The WHERE and ORDER BY clauses can be combined in one } The result of a query can be sorted in ascending or descending order using the optional ORDER BY clause. The simplest form of an ORDER BY clause is SELECT columnname1, columnname2, FROM tablename ORDER

More information

CERTIFICATE IN WEB PROGRAMMING

CERTIFICATE IN WEB PROGRAMMING COURSE DURATION: 6 MONTHS CONTENTS : CERTIFICATE IN WEB PROGRAMMING 1. PROGRAMMING IN C and C++ Language 2. HTML/CSS and JavaScript 3. PHP and MySQL 4. Project on Development of Web Application 1. PROGRAMMING

More information

Mount Saint Mary College, Newburgh, NY Internet Programming III - CIT310

Mount Saint Mary College, Newburgh, NY Internet Programming III - CIT310 Warm up mini-lab Lab 1 - Functions Type in the following function definition and calls to the function. Test it and understand it. function myprint($str= No String Supplied ) // the argument is optional

More information

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable Basic C++ Overview C++ is a version of the older C programming language. This is a language that is used for a wide variety of applications and which has a mature base of compilers and libraries. C++ is

More information

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

PHP: The Basics CISC 282. October 18, Approach Thus Far PHP: The Basics CISC 282 October 18, 2017 Approach Thus Far User requests a webpage (.html) Server finds the file(s) and transmits the information Browser receives the information and displays it HTML,

More information

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING KEY CONCEPTS COMP 10 EXPLORING COMPUTER SCIENCE Lecture 2 Variables, Types, and Programs Problem Definition of task to be performed (by a computer) Algorithm A particular sequence of steps that will solve

More information

Manju Muralidharan Priya. CS4PM Web Aesthetics and Development WEEK 11

Manju Muralidharan Priya. CS4PM Web Aesthetics and Development WEEK 11 CS4PM Web Aesthetics and Development WEEK 11 Objective: Understand basics of JScript Outline: a. Basics of JScript Reading: Refer to w3schools websites and use the TRY IT YOURSELF editor and play with

More information

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies Internet t Software Technologies JavaScript part one IMCNE A.A. 2008/09 Gabriele Cecchetti Why introduce JavaScript To add dynamicity and interactivity to HTML pages 2 What s a script It s a little interpreted

More information

Mysql Tutorial Show Table Like Name Not >>>CLICK HERE<<<

Mysql Tutorial Show Table Like Name Not >>>CLICK HERE<<< Mysql Tutorial Show Table Like Name Not SHOW TABLES LIKE '%shop%' And the command above is not working as Table name and next SHOW CREATE TABLEcommand user889349 Apr 18. If you do not want to see entire

More information

Introduction to programming with Python

Introduction to programming with Python Introduction to programming with Python Ing. Lelio Campanile 1/61 Main Goal - Introduce you to programming - introduce you to the most essential feature of python programming 2/61 Before to start The name

More information

Stored procedures - what is it?

Stored procedures - what is it? For a long time to suffer with this issue. Literature on the Internet a lot. I had to ask around at different forums, deeper digging in the manual and explain to himself some weird moments. So, short of

More information

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

WINTER. Web Development. Template. PHP Variables and Constants. Lecture WINTER Template Web Development PHP Variables and Constants Lecture-3 Lecture Content What is Variable? Naming Convention & Scope PHP $ and $$ Variables PHP Constants Constant Definition Magic Constants

More information

Open Source Web Application Development - CS310

Open Source Web Application Development - CS310 2018 Open Source Web Application Development - CS310 KASHIF ADEEL bc140401362@vu.edu.pk Introduction PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.

More information

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic BIT 3383 Java Programming Sem 1 Session 2011/12 Chapter 2 JAVA basic Objective: After this lesson, you should be able to: declare, initialize and use variables according to Java programming language guidelines

More information

Introduction to Databases and SQL

Introduction to Databases and SQL Introduction to Databases and SQL Files vs Databases In the last chapter you learned how your PHP scripts can use external files to store and retrieve data. Although files do a great job in many circumstances,

More information

Alan Forbes - The Joy of PHP 1

Alan Forbes - The Joy of PHP 1 Alan Forbes - The Joy of PHP 1 The Joy of Programming PHP Copyright 2013 by Alan Forbes. All rights reserved, including the right to reproduce this book, or portions thereof, in any form. The scanning,

More information

SEEM4570 System Design and Implementation Lecture 03 JavaScript

SEEM4570 System Design and Implementation Lecture 03 JavaScript SEEM4570 System Design and Implementation Lecture 03 JavaScript JavaScript (JS)! Developed by Netscape! A cross platform script language! Mainly used in web environment! Run programs on browsers (HTML

More information

What we will do today Explain and look at examples of. Programs that examine data. Data types. Topic 4. variables. expressions. assignment statements

What we will do today Explain and look at examples of. Programs that examine data. Data types. Topic 4. variables. expressions. assignment statements Topic 4 Variables Once a programmer has understood the use of variables, he has understood the essence of programming -Edsger Dijkstra What we will do today Explain and look at examples of primitive data

More information