SlideShare a Scribd company logo
1 of 18
PHPHypertext Preprocessor
By : Ammar khan
Index
 What is PHP ?
 Why use PHP ?
 What can PHP do ?
 PHP Syntax
 Tools Required
 Practical work
What is PHP
 PHP ( Hypertext Preprocessor ) is a general-purpose programming
language originally designed for web development.
 PHP is a server side scripting language. that is used to develop Static
websites or Dynamic websites or Web applications.
 78.9% of whole web. Every 8 websites out of 10 are using PHP in on or
other way.
 An PHP file can consist of HTML, CSS, JAVASCRIPT and of course PHP.
 Facebook , Wikipedia , Flicker, Tumbler And Yahoo are some global
companies using PHP in their products.
Why use PHP ?
 Security PHP frameworks built-in feature and tools make it easier to
protect the web applications from the outer attacks and security threats.
 High Speed PHP is very fast programming language because it uses its
own memory for processing.
 Scalability PHP is very flexible and capable language it can handle from
a “Hello World “ app to a Facebook size project.
 Loosely Typed Language PHP is loosely typed language and best for
beginners
 Open Source PHP is an open source it doesn’t require any additional
expensive software to work with.
What can PHP do
 PHP can generate dynamic page content
 PHP can create , open , read, delete and close files on server
 PHP can collect form data
 PHP can add, delete, modify and retrieve data in database.
Our Usage
PHP
KOTLIN
JavaScript
Others
Work cycle of PHP
Basic syntax
 A PHP script can be placed anywhere in the document.
 A PHP script starts with <?php and ends with ?>
Basic Syntax
<HTML>
<head>
<title> I am title </title>
</head>
<body>
<h1>
Hello <?php $_GET[“user_name”] ?>
</h1>
</body>
</HTML>
Lets Take Shortcut
Tools Required
Frequently used functions
 Echo
 isset()
 Loops (for, while)
 Conditional statements (if else)
 mysqli_connect()
 mysqli_query()
Echo
<?php echo” Hello world ”; ?>
Echo function is a powerful and basic function of PHP . It could be used at
different places for different purposes. Following are some basic features
of echo function.
 Out put one or more strings
 Can output HTML , CSS and JavaScript content
 Used to create dynamic content
Isset()
<?php
$name=’Ammar’;
if(isset($name){
echo”variable found”;
}
?>
 The isset () function is used to check whether a variable is set or not.
 If a variable is already unset with unset() function, it will no longer be
set.
 The isset() function return false if testing variable contains a NULL value.
Loops (for, while)
<?php
for($i=1; $i<=3; $i++ ){
echo "The number is " . $i . "<br>";
}
?>
For loop
While loop
<?php
$i=1;
while( $i<=3){
$i++ ;
echo "The number is " . $i . "<br>";
}
?>
Conditional Statement (if else)
<?php
$marks=40;
if($marks > 40 ){
echo "You are pass ";
}
else{
echo "You are fail ";
}
?>
mysqli_connect()
<?php
$host=”localhost”;
$user=”root”;
$password=””;
$db=”my_database”;
$conn=mysqli_connect($host,$user,$password,$db);
?>
The mysqli_connect() function opens a new connection to the MySQL server.
mysqli_query()
<?php
$query=”SELECT * FROM user where user_id=1”;
$do_query=mysqli_query($conn,$query);
If(!$do_query){
echo “query failed”;
}
?>
The mysqli_query() function performs a query against the database.

More Related Content

What's hot (20)

PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php
PhpPhp
Php
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
01 Php Introduction
01 Php Introduction01 Php Introduction
01 Php Introduction
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)
 
Software Design
Software DesignSoftware Design
Software Design
 
Php & mysql course syllabus
Php & mysql course syllabusPhp & mysql course syllabus
Php & mysql course syllabus
 
Php tutorial
Php  tutorialPhp  tutorial
Php tutorial
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Beginners PHP Tutorial
Beginners PHP TutorialBeginners PHP Tutorial
Beginners PHP Tutorial
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Php
PhpPhp
Php
 
PHP in one presentation
PHP in one presentationPHP in one presentation
PHP in one presentation
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginnersPHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
 

Similar to Php (20)

Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
PHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERSPHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERS
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
 
How PHP works
How PHP works How PHP works
How PHP works
 
Php unit i
Php unit i Php unit i
Php unit i
 
Php
PhpPhp
Php
 
Php Interview Questions
Php Interview QuestionsPhp Interview Questions
Php Interview Questions
 
Php
PhpPhp
Php
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
PHP
 PHP PHP
PHP
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Php ppt
Php pptPhp ppt
Php ppt
 
PHP TUTORIAL
PHP TUTORIALPHP TUTORIAL
PHP TUTORIAL
 
Applied+Web+Development+[Autosaved].pptx
Applied+Web+Development+[Autosaved].pptxApplied+Web+Development+[Autosaved].pptx
Applied+Web+Development+[Autosaved].pptx
 
Php notes
Php notesPhp notes
Php notes
 
Php basics
Php basicsPhp basics
Php basics
 
php basics
php basicsphp basics
php basics
 
PHP.ppt
PHP.pptPHP.ppt
PHP.ppt
 
a brief introduction to PHP and how to use it.
a brief introduction to PHP and how to use it.a brief introduction to PHP and how to use it.
a brief introduction to PHP and how to use it.
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysql
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Php

  • 2. Index  What is PHP ?  Why use PHP ?  What can PHP do ?  PHP Syntax  Tools Required  Practical work
  • 3. What is PHP  PHP ( Hypertext Preprocessor ) is a general-purpose programming language originally designed for web development.  PHP is a server side scripting language. that is used to develop Static websites or Dynamic websites or Web applications.  78.9% of whole web. Every 8 websites out of 10 are using PHP in on or other way.  An PHP file can consist of HTML, CSS, JAVASCRIPT and of course PHP.  Facebook , Wikipedia , Flicker, Tumbler And Yahoo are some global companies using PHP in their products.
  • 4. Why use PHP ?  Security PHP frameworks built-in feature and tools make it easier to protect the web applications from the outer attacks and security threats.  High Speed PHP is very fast programming language because it uses its own memory for processing.  Scalability PHP is very flexible and capable language it can handle from a “Hello World “ app to a Facebook size project.  Loosely Typed Language PHP is loosely typed language and best for beginners  Open Source PHP is an open source it doesn’t require any additional expensive software to work with.
  • 5. What can PHP do  PHP can generate dynamic page content  PHP can create , open , read, delete and close files on server  PHP can collect form data  PHP can add, delete, modify and retrieve data in database.
  • 8. Basic syntax  A PHP script can be placed anywhere in the document.  A PHP script starts with <?php and ends with ?>
  • 9. Basic Syntax <HTML> <head> <title> I am title </title> </head> <body> <h1> Hello <?php $_GET[“user_name”] ?> </h1> </body> </HTML>
  • 12. Frequently used functions  Echo  isset()  Loops (for, while)  Conditional statements (if else)  mysqli_connect()  mysqli_query()
  • 13. Echo <?php echo” Hello world ”; ?> Echo function is a powerful and basic function of PHP . It could be used at different places for different purposes. Following are some basic features of echo function.  Out put one or more strings  Can output HTML , CSS and JavaScript content  Used to create dynamic content
  • 14. Isset() <?php $name=’Ammar’; if(isset($name){ echo”variable found”; } ?>  The isset () function is used to check whether a variable is set or not.  If a variable is already unset with unset() function, it will no longer be set.  The isset() function return false if testing variable contains a NULL value.
  • 15. Loops (for, while) <?php for($i=1; $i<=3; $i++ ){ echo "The number is " . $i . "<br>"; } ?> For loop While loop <?php $i=1; while( $i<=3){ $i++ ; echo "The number is " . $i . "<br>"; } ?>
  • 16. Conditional Statement (if else) <?php $marks=40; if($marks > 40 ){ echo "You are pass "; } else{ echo "You are fail "; } ?>
  • 18. mysqli_query() <?php $query=”SELECT * FROM user where user_id=1”; $do_query=mysqli_query($conn,$query); If(!$do_query){ echo “query failed”; } ?> The mysqli_query() function performs a query against the database.