SlideShare une entreprise Scribd logo
1  sur  36
Prepared by: 
Chandan Das 
B.Tech 5th Semester 
Dept of CSE 
CIT , KOKRAJHAR
INTRODUCTION 
• It is an interpreted, server-side scripting language. 
• Originally designed for web development. 
• Similar languages are Perl, ASP.NET, Ruby, JSP (Java 
Server Pages) 
• Embedded into HTML 
• Can use DB (MySQL, Oracle, Microsoft SQL, Postgre 
SQL)
PHP stands for?? 
Personal Home Page
HISTORY 
• Began in 1994 by Rasmus Lerdorf 
• Soon he named PHP/FI to build simple, dynamic web 
applications. 
• In 1995 -the release of PHP/FI as "Personal Home Page 
Tools (PHP Tools) version 1.0". 
• In 1997 Zeev Suraski and Andi Gutmans rewrote 
the parser and formed the base of PHP 3, changing the 
name PHP: Hypertext Preprocessor. 
• On May,2000, PHP 4 was released, 
• On July , 2004, PHP 5 was released, powered by the new 
Zend Engine II. 
• In 2008 PHP 5 became the only stable version under 
development. 
• Finally after a vote the current version released in 2014 .
SCRIPTING LANGUAGE
SCRIPTING LANGUAGE 
• A scripting language is: 
– cross-platform since interpreter is easy to port 
– implicit variable declaration 
– compiled on demand 
– Extending 
– Glue programming
HOW PHP WORKS??
BASIC PHP SYNTAX 
<?php 
?>
VARIABLES IN PHP 
• All variables in PHP start with a $ sign symbol. 
• Variables may contain strings, numbers, or arrays. 
<html> 
<body> 
<?php $txt="Hello World"; echo $txt; 
?> 
</body> 
</html>
DATA TYPES 
• String 
$name=“x” 
– 'My name is x.' 
– "My name is $name." 
• Boolean 
• Integer 
• Floating point 
• Array 
– $a=array("tokyo", "hanoi", "london") 
– $a=array("japan" => "tokyo", "vietnam" => 
"hanoi", "england" => "london") 
– $a[2] 
– $a["vietnam"]
STRING HANDLING 
• String literals (constants) enclosed in double quotes “ ” 
or single quotes ‘ ’ 
• Within “”, variables are replaced by their value: – called 
variable interpolation. “My name is $name, I think” 
• Strings are concatenated (joined end to end) with the 
dot operator “key”.”board” == “keyboard”
THE IF...ELSE STATEMENT 
Syntax 
if (condition) 
code to be executed if condition is true; 
else 
code to be executed if condition is false;
Syntax 
switch (expression) 
{ 
case label1: code to be executed if expression = 
label1; break; 
case label2: code to be executed if expression = 
label2; break; 
default: code to be executed if expression 
is different from both label1 
and label2; 
} 
THE SWITCH STATEMENT
PHP FUNCTION 
• Strlen(); 
• Strcmp(); 
• Date(); 
• Time(); 
• Include(); 
• Require();
STATE MANAGEMENT 
• It is used to help web 
applications to maintain 
their state across several 
HTTP requests when 
needed. 
• Cookies 
• Session
SESSION 
• Better option of cookie 
• Store information about a user. They 
are available only for a particular 
application and hold information of 
only one single user.
Syntax: 
<?php start_session(); ?>
<?php start_session(); 
$_SESSION[‘user_name’]=‘’ 
$_SESSION[‘pwd’]=‘’ 
?> //create a session
select username,password 
From table 
Where username=‘textbox1’ and 
password=‘textbox2’
<?php start_session(); 
$_SESSION[‘user_name’]= 
$_SESSION[‘pwd’]= 
if(isset($_SESSION[‘username’])) 
Echo “Welcome”. $_SESSION[‘name’] 
?> //retrieve a session
• session_destroy(); 
• unset(); 
<?php start_session(); 
$_SESSION[‘user_name’]= 
if(isset($_POST[“lgt_btn"])) 
unset($_SESSION[‘user_name’]); 
?> Name of the 
Logout button
FEATURES OF PHP 
– Support for MySQL, Oracle, dbm, DB2, 
PostgreSQL 
– Can connect to any database which 
provides an ODBC driver (Open Database 
Connectivity Standard) – e.g. MS Access. 
– Supported on Windows, Mac OS X, other 
Unix-like systems (e.g. Linux). 
– Similar syntax and features as C++ and Java. 
– PHP designer,Wampp/Xampp are free of 
cost.
REFERENCES 
• Wikipedia 
• Google images 
• www.w3schools.com
THANK YOU

Contenu connexe

Tendances

Php Server Var
Php Server VarPhp Server Var
Php Server Vararvind34
 
Introduction To Power Shell
Introduction To Power ShellIntroduction To Power Shell
Introduction To Power ShellIvan Suhinin
 
PowerShell 101
PowerShell 101PowerShell 101
PowerShell 101Thomas Lee
 
Nette framework (WebElement #28)
Nette framework (WebElement #28)Nette framework (WebElement #28)
Nette framework (WebElement #28)Adam Štipák
 
2018 05-11 the way we teach tech - phpday
2018 05-11 the way we teach tech - phpday2018 05-11 the way we teach tech - phpday
2018 05-11 the way we teach tech - phpdayJeroen van der Gulik
 
Getting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot FrameworkGetting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot FrameworkSarah Sexton
 
Word Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with TraceryWord Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with TracerySarah Sexton
 
An Introduction to Symfony
An Introduction to SymfonyAn Introduction to Symfony
An Introduction to Symfonyxopn
 
Web application, cookies and sessions
Web application, cookies and sessionsWeb application, cookies and sessions
Web application, cookies and sessionshamsa nandhini
 
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and GrailsPhilip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and GrailsPhilip Stehlik
 
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line KeystrokesEfficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line KeystrokesSeth Miller
 
Development of Ansible modules
Development of Ansible modulesDevelopment of Ansible modules
Development of Ansible modulesjtyr
 

Tendances (19)

Php Server Var
Php Server VarPhp Server Var
Php Server Var
 
Introduction To Power Shell
Introduction To Power ShellIntroduction To Power Shell
Introduction To Power Shell
 
Php workshop L04 database
Php workshop L04 databasePhp workshop L04 database
Php workshop L04 database
 
PHP
PHPPHP
PHP
 
PowerShell 101
PowerShell 101PowerShell 101
PowerShell 101
 
Sa
SaSa
Sa
 
Nette framework (WebElement #28)
Nette framework (WebElement #28)Nette framework (WebElement #28)
Nette framework (WebElement #28)
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
 
2018 05-11 the way we teach tech - phpday
2018 05-11 the way we teach tech - phpday2018 05-11 the way we teach tech - phpday
2018 05-11 the way we teach tech - phpday
 
Php Training Workshop by Vtips
Php Training Workshop by VtipsPhp Training Workshop by Vtips
Php Training Workshop by Vtips
 
17 sessions
17 sessions17 sessions
17 sessions
 
Getting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot FrameworkGetting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot Framework
 
Word Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with TraceryWord Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with Tracery
 
An Introduction to Symfony
An Introduction to SymfonyAn Introduction to Symfony
An Introduction to Symfony
 
Web application, cookies and sessions
Web application, cookies and sessionsWeb application, cookies and sessions
Web application, cookies and sessions
 
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and GrailsPhilip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
 
Unix shell scripting tutorial
Unix shell scripting tutorialUnix shell scripting tutorial
Unix shell scripting tutorial
 
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line KeystrokesEfficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
 
Development of Ansible modules
Development of Ansible modulesDevelopment of Ansible modules
Development of Ansible modules
 

En vedette

Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHPprabhatjon
 
Data types in php
Data types in phpData types in php
Data types in phpilakkiya
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?Ravi Raj
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life CycleXinchen Hui
 
Beginners PHP Tutorial
Beginners PHP TutorialBeginners PHP Tutorial
Beginners PHP Tutorialalexjones89
 
Free PHP Book Online | PHP Development in India
Free PHP Book Online | PHP Development in IndiaFree PHP Book Online | PHP Development in India
Free PHP Book Online | PHP Development in IndiaDeepak Rajput
 

En vedette (8)

How PHP works
How PHP works How PHP works
How PHP works
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Data types in php
Data types in phpData types in php
Data types in php
 
Introduction to PHP Basics
Introduction to PHP BasicsIntroduction to PHP Basics
Introduction to PHP Basics
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
 
Beginners PHP Tutorial
Beginners PHP TutorialBeginners PHP Tutorial
Beginners PHP Tutorial
 
Free PHP Book Online | PHP Development in India
Free PHP Book Online | PHP Development in IndiaFree PHP Book Online | PHP Development in India
Free PHP Book Online | PHP Development in India
 

Similaire à PHP

Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)Muhamad Al Imran
 
Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010Michelangelo van Dam
 
HackU PHP and Node.js
HackU PHP and Node.jsHackU PHP and Node.js
HackU PHP and Node.jssouridatta
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckrICh morrow
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentationAnnujj Agrawaal
 
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...anshkhurana01
 
Website designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentWebsite designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentCss Founder
 
phpwebdev.ppt
phpwebdev.pptphpwebdev.ppt
phpwebdev.pptrawaccess
 

Similaire à PHP (20)

Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
 
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
 
Php with mysql ppt
Php with mysql pptPhp with mysql ppt
Php with mysql ppt
 
Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010
 
Starting Out With PHP
Starting Out With PHPStarting Out With PHP
Starting Out With PHP
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
HackU PHP and Node.js
HackU PHP and Node.jsHackU PHP and Node.js
HackU PHP and Node.js
 
Prersentation
PrersentationPrersentation
Prersentation
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course Deck
 
INTRODUCTION to php.pptx
INTRODUCTION to php.pptxINTRODUCTION to php.pptx
INTRODUCTION to php.pptx
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentation
 
Phphacku iitd
Phphacku iitdPhphacku iitd
Phphacku iitd
 
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Website designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentWebsite designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopment
 
Php1
Php1Php1
Php1
 
phpwebdev.ppt
phpwebdev.pptphpwebdev.ppt
phpwebdev.ppt
 

Dernier

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 

Dernier (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

PHP

  • 1. Prepared by: Chandan Das B.Tech 5th Semester Dept of CSE CIT , KOKRAJHAR
  • 2. INTRODUCTION • It is an interpreted, server-side scripting language. • Originally designed for web development. • Similar languages are Perl, ASP.NET, Ruby, JSP (Java Server Pages) • Embedded into HTML • Can use DB (MySQL, Oracle, Microsoft SQL, Postgre SQL)
  • 3. PHP stands for?? Personal Home Page
  • 4.
  • 5. HISTORY • Began in 1994 by Rasmus Lerdorf • Soon he named PHP/FI to build simple, dynamic web applications. • In 1995 -the release of PHP/FI as "Personal Home Page Tools (PHP Tools) version 1.0". • In 1997 Zeev Suraski and Andi Gutmans rewrote the parser and formed the base of PHP 3, changing the name PHP: Hypertext Preprocessor. • On May,2000, PHP 4 was released, • On July , 2004, PHP 5 was released, powered by the new Zend Engine II. • In 2008 PHP 5 became the only stable version under development. • Finally after a vote the current version released in 2014 .
  • 7. SCRIPTING LANGUAGE • A scripting language is: – cross-platform since interpreter is easy to port – implicit variable declaration – compiled on demand – Extending – Glue programming
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. BASIC PHP SYNTAX <?php ?>
  • 18. VARIABLES IN PHP • All variables in PHP start with a $ sign symbol. • Variables may contain strings, numbers, or arrays. <html> <body> <?php $txt="Hello World"; echo $txt; ?> </body> </html>
  • 19. DATA TYPES • String $name=“x” – 'My name is x.' – "My name is $name." • Boolean • Integer • Floating point • Array – $a=array("tokyo", "hanoi", "london") – $a=array("japan" => "tokyo", "vietnam" => "hanoi", "england" => "london") – $a[2] – $a["vietnam"]
  • 20. STRING HANDLING • String literals (constants) enclosed in double quotes “ ” or single quotes ‘ ’ • Within “”, variables are replaced by their value: – called variable interpolation. “My name is $name, I think” • Strings are concatenated (joined end to end) with the dot operator “key”.”board” == “keyboard”
  • 21. THE IF...ELSE STATEMENT Syntax if (condition) code to be executed if condition is true; else code to be executed if condition is false;
  • 22. Syntax switch (expression) { case label1: code to be executed if expression = label1; break; case label2: code to be executed if expression = label2; break; default: code to be executed if expression is different from both label1 and label2; } THE SWITCH STATEMENT
  • 23. PHP FUNCTION • Strlen(); • Strcmp(); • Date(); • Time(); • Include(); • Require();
  • 24. STATE MANAGEMENT • It is used to help web applications to maintain their state across several HTTP requests when needed. • Cookies • Session
  • 25. SESSION • Better option of cookie • Store information about a user. They are available only for a particular application and hold information of only one single user.
  • 27. <?php start_session(); $_SESSION[‘user_name’]=‘’ $_SESSION[‘pwd’]=‘’ ?> //create a session
  • 28.
  • 29. select username,password From table Where username=‘textbox1’ and password=‘textbox2’
  • 30.
  • 31. <?php start_session(); $_SESSION[‘user_name’]= $_SESSION[‘pwd’]= if(isset($_SESSION[‘username’])) Echo “Welcome”. $_SESSION[‘name’] ?> //retrieve a session
  • 32. • session_destroy(); • unset(); <?php start_session(); $_SESSION[‘user_name’]= if(isset($_POST[“lgt_btn"])) unset($_SESSION[‘user_name’]); ?> Name of the Logout button
  • 33.
  • 34. FEATURES OF PHP – Support for MySQL, Oracle, dbm, DB2, PostgreSQL – Can connect to any database which provides an ODBC driver (Open Database Connectivity Standard) – e.g. MS Access. – Supported on Windows, Mac OS X, other Unix-like systems (e.g. Linux). – Similar syntax and features as C++ and Java. – PHP designer,Wampp/Xampp are free of cost.
  • 35. REFERENCES • Wikipedia • Google images • www.w3schools.com