SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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
 

Similar a 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
 

Similar a 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
 

Último

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 

Último (20)

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 

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