Introduction of PHP Created By: Umar Farooque Khan

Similar documents
Web Engineering (Lecture 08) WAMP

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

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

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

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

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

Lecture 7 PHP Basics. Web Engineering CC 552

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

Princess Nourah bint Abdulrahman University. Computer Sciences Department

PHP by Pearson Education, Inc. All Rights Reserved.

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley

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

AN INTRODUCTION TO PHP

CSC Web Programming. Introduction to JavaScript

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

PHP. Interactive Web Systems

Web Scripting using PHP

PHP Development - Introduction

PHP 1. Introduction Temasek Polytechnic

B. V. Patel Institute of BMC & IT 2014

School of Information and Computer Technology Sirindhorn International Institute of Technology Thammasat University

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

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

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

JavaScript Functions, Objects and Array

Lecture 12. PHP. cp476 PHP

Agenda. 1. Brief History of PHP. 2. Getting started. 3. Examples

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

Important Points about PHP:

Programming In Java Prof. Debasis Samanta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

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

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

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

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

Full file at

Database Visual ARCHITECT 5.2

This lecture. PHP tags

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

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

Govt. of Karnataka, Department of Technical Education Diploma in Computer Science & Engineering. Fifth Semester. Subject: Web Programming

PHP: Hypertext Preprocessor. A tutorial Introduction

Database Visual ARCHITECT 6.3

Babu Madhav Institute of Information Technology, UTU 2017

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

DEPARTMENT OF MATHS, MJ COLLEGE

Basic PHP Lecture 17

Manju Muralidharan Priya. CS4PM Web Aesthetics and Development WEEK 11

Programming with Java

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

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

PHP BASICS BY ALL-TECH SYSTEMS & CO

COMP284 Scripting Languages Lecture 11: PHP (Part 3) Handouts

Database-Enabled Web Applications.! Introduction to PHP! Connecting to IBM DB2 with PHP

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

Alpha College of Engineering and Technology. Question Bank

Expressions and Variables

Choosing the Right BarTender Edition

Part I. Web Technologies for Interactive Multimedia

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


Web Scripting using PHP

Chapter 3 - Introduction to Java Applets

Oracle Compare Two Database Tables Sql Query List All

Creating a C++ Program

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

Running SQL in Java and PHP

CS6501 IP Unit IV Page 1

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

Inf 202 Introduction to Data and Databases (Spring 2010)

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

welcome to BOILERCAMP HOW TO WEB DEV

CMPS 401 Survey of Programming Languages

Scripting Languages. Diana Trandabăț

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

CPSC 481: CREATIVE INQUIRY TO WSBF

COMP519 Web Programming Lecture 27: PHP (Part 3) Handouts

If you are looking for the ebook SQL: Beginner s Guide for Coding SQL (database programming, computer programming, how to program, sql for dummies,

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

Server-side Web Development (I3302) Semester: 1 Academic Year: 2017/2018 Credits: 4 (50 hours) Dr Antoun Yaacoub

Class 2: Variables and Memory. Laura Marik Spring 2012 C++ Course Notes (Provided by Jason Minski)

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

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

Course Outline. Introduction to java

CSCE 120: Learning To Code

PHP INTERVIEW QUESTION-ANSWERS

PHP. MIT 6.470, IAP 2010 Yafim Landa

CSc Introduction to Computing

CGS 3066: Spring 2015 JavaScript Reference

PHP. control structures - loops indexed arrays. Recap: PHP files are processed top to bottom in sequence. Starting at the top

PHP Hypertext Preprocessor

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

1. Cascading Style Sheet and JavaScript

Database Systems Fundamentals

Group A: Assignment No 2

SQL Data Definition Language: Create and Change the Database Ray Lockwood

JAVASCRIPT BASICS. Type-Conversion in JavaScript. Type conversion or typecasting is one of the very important concept in

Principles of Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore

Tutorial Php Coding Projects Pdf Beginners With Examples

Distributed Databases and Remote Access to a Database

Getting started with Java

Transcription:

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. PHP script run on web server. PHP is used for dynamic web page creation. PHP run on variety of operating system. GUI based operating system as well as Command based. PHP can easily embedded with HTML. PHP is open source programming language so you can download PHP free and use it. PHP support many databases are following below. You can download from www.php.net Why PHP? It s fast It s free It s easy to use

3 It s versatile It s secure It s customizable Interact with HTML forms Communicate with databases Generate secure Web pages Easy to learn and implement. How to start learning PHP For windows go to http://www.wampserver.com and download latest version of wamp server. Install that exe on your machine and run PHP script. Note : If you want to know detailed process of wamp server visit http://. You should have basic knowledge of following Html Java Script Css

4 Supported Databases dbase Informix Ingres Microsoft SQL Server msql MySQL Oracle PostgreSQL Sybase Basic Syntax <html> <head> <title>first Script of PHP</title> </head> <body> echo Welcome to the php word!"; echo ;

5 </body> </html> Note: If you want to learn more about PHP visit. Commenting continued in PHP PHP supports two type of commenting 1. Single line comment 2. Multi line Comment Single line comment There are two method of single line commenting. By using hash sign (#) By using backslaps (//) Both are following below you can see that echo Comment in php"; // Single line Comment #this also a single line comment

6 echo "; Multi line Comment echo Comment in php ; echo Multiple line comment"; /* this multi line comment You can put any number of line */ echo ";? Echo Statement In PHP echo statement is used for deliver the string as well as variable value on the browse, following example explain the concept of echo statement. echo Welcome to the php word!"; $number=38; echo $number; $str= ; Echo $str;

7 The Semicolon and Case Sensitivity Every statement must be terminated with semicolon. In PHP functions, classes, core language keywords are caseinsensitive. Following example explain the concept of semicolon and case sensitivity. echo Welcome to the php word!"; Echo http:// ; //case insensitive PHP Variables Variables are just identifier that are used for storing data, like integer, float, strings, and arrays. PHP automatically converts the variable to the correct data type, depending on its value. In PHP there is no need to declare before use. Dollar sign is used at the time of making variable.

8 Syntax of declare the variable $variable_name = value; Rules of making PHP variable It must be starts with dollar ($) sign. A variable name can only contain alpha-numeric characters, underscores (a-z, A-Z, 0-9, and _) you cannot start with number. A valid variable name start with string or underscore after dollar sign. PHP variable can any length. PHP variables are case sensitive. You cannot leave blank space between variable names. $first name = value; $first_name = value; not allowed allowed Example of valid variable $name=52; $name_1=12; $var145af=102; $_php=586; $a145= java ; $first_name_1=4875;

9 Example of PHP Variable $txt= http:// ; $Number=152; $a=18.5; Echo $number. $a; Explanation In above example you can see that there is no need to define data type. PHP Concatenation (String Concatenation) In PHP dot (.) operator is used for concatenation of two or more string following explain the concept of the string concatenation. $txt= http:// ; $txt2= Hello ;

10 echo $txt.. $txt2; PHP and html embed code PHP script embeds anywhere and any number of times in html code, following example explain how to embed PHP script in html. <html> <head> <title> echo html embedded code ; </title> </Head> echo "hello friends"."<br>"; echo "welcome to the PHP<br>"; echo "Html and php script embed"; $a=15; $b=25;

11 $sum=$a+$b; echo $sum; <body> </body> </html> Explanation You can put your PHP script anywhere in you html document like above example shown. How to put your html code in PHP script You can also put html tags in PHP script within the echo statement like that echo "<h4>welcome to the PHP</h4>"; echo "<br>";

12 echo "Html and php script embed<hr>"; echo "<b>"."hello friends"."</b>"; print "<hr>"; Constant In PHP, constant is nothing it just variable that holds fixed value. You can define constant by using define keyword. As the name implies, you cannot change these constants once they represent a certain value. The names for constants have the same rules as PHP variables except that they don t have the leading dollar sign. Syntax of PHP constant define ( " variable name ", " value " ) ; Example of PHP constant define ( " Pi ",3.14)

13 Example of PHP constant define("str", "This is a String Constant"); define("integer", 38); echo str; echo '<br>'; echo "this is integer constant:-"; echo integer; echo '<br>'; Some of important pre define constant

14 Example of pre define constant echo "line number of this lie: ". LINE."<br>";