PHP Introduction
PHP : Hypertext Preprocessor”
It is a widely-used open source general-purpose
scripting language that is especially suited for
web development and can be embedded into
HTML.
PHP Introduction
> PHP is a server-side scripting language
> PHP scripts are executed on the server
> PHP supports many databases (MySQL,
Informix, Oracle, Sybase, Solid, PostgreSQL,
Generic ODBC, etc.)
> PHP is open source software
> PHP is free to download and use
PHP Introduction
> PHP runs on different platforms (Windows,
Linux, Unix, etc.)
> PHP is compatible with almost all servers used
today (Apache, IIS, etc.)
> PHP is FREE to download from the official PHP
resource: www.php.net
> PHP is easy to learn and runs efficiently on the
server side
Java Script and PHP
Features
PHP -Process
Installation
 Text Editor
 Web Server
https://notepad-plus-plus.org/downloads
https://www.apachefriends.org/index.html
PHP – Programming Concepts
Basic Syntax:
1. The PHP code is enclosed in special start and
end processing instructions <?php and ?>.
2. A PHP file is saved with the exrtension .php
3. It normally has HTML Tags, and some PHP
scripting code.
PHP code is executed on the server, generating
HTML which is then sent to the client. The client
would receive the results of running that script.
PHP Introduction
In Notepad++, Click File ->
Save
Save in htdocs folder in
XAMPP folder
Create a folder (test) and save
with .php extension
Open browser and use URL
https://localhost/text/hello.php
Execution Steps
PHP –Programming Concepts
This program is extremely simple and you really did not
need to use PHP to create a page like this. All it does is
display: Hello World using the PHP echo() statement.
Keywords:
PHP Comments
In PHP, we use // to
make a single-line
comment or /* and */ to
make a large comment
block.
PHP Variables
> Variables are used for storing values, like text
strings, numbers or arrays.
> When a variable is declared, it can be used over
and over again in your script.
> All variables in PHP start with a $ sign symbol.
Syntax: Example
PHP Operators
Operators are used to operate on values. There
are four classifications of operators:
> Arithmetic
> Assignment
> Comparison
> Logical
PHP Operators
PHP Operators
PHP Operators
PHP Operators
GET and POST Methods
There are two types of websites
The websites with multiple
web pages that share the
user data with each other
are known as Dynamic
Websites
The websites with static
data (the data in each web
page remains unhanged)
is called Static Website
1. GET and POST methods are used by websites
to share user’s data among its web pages.
Therefore these methods are used to create
dynamic webpages.
2. GET & POST methods are the http request
methods used inside <form> tag to send data to
the server.
Syntax:
<form action=“web page address” method=“POST”>
Sample Code
Activity
Write PHP Code to print area of
rectangle on webpage
(use POST Method)
1.PHP-> Scripting Language to
create web applications
2. PHP require a web server
3. GET and POST methods are the
HTTP request methods used inside
<form> tag to send data to the
server.
Conclusion:

INTRODUCTION TO PHP.ppt

  • 1.
    PHP Introduction PHP :Hypertext Preprocessor” It is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
  • 2.
    PHP Introduction > PHPis a server-side scripting language > PHP scripts are executed on the server > PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.) > PHP is open source software > PHP is free to download and use
  • 3.
    PHP Introduction > PHPruns on different platforms (Windows, Linux, Unix, etc.) > PHP is compatible with almost all servers used today (Apache, IIS, etc.) > PHP is FREE to download from the official PHP resource: www.php.net > PHP is easy to learn and runs efficiently on the server side
  • 4.
  • 5.
  • 6.
  • 7.
    Installation  Text Editor Web Server https://notepad-plus-plus.org/downloads https://www.apachefriends.org/index.html
  • 8.
    PHP – ProgrammingConcepts Basic Syntax: 1. The PHP code is enclosed in special start and end processing instructions <?php and ?>. 2. A PHP file is saved with the exrtension .php 3. It normally has HTML Tags, and some PHP scripting code. PHP code is executed on the server, generating HTML which is then sent to the client. The client would receive the results of running that script.
  • 9.
  • 10.
    In Notepad++, ClickFile -> Save Save in htdocs folder in XAMPP folder Create a folder (test) and save with .php extension Open browser and use URL https://localhost/text/hello.php Execution Steps
  • 11.
    PHP –Programming Concepts Thisprogram is extremely simple and you really did not need to use PHP to create a page like this. All it does is display: Hello World using the PHP echo() statement. Keywords:
  • 12.
    PHP Comments In PHP,we use // to make a single-line comment or /* and */ to make a large comment block.
  • 13.
    PHP Variables > Variablesare used for storing values, like text strings, numbers or arrays. > When a variable is declared, it can be used over and over again in your script. > All variables in PHP start with a $ sign symbol. Syntax: Example
  • 14.
    PHP Operators Operators areused to operate on values. There are four classifications of operators: > Arithmetic > Assignment > Comparison > Logical
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
    GET and POSTMethods There are two types of websites The websites with multiple web pages that share the user data with each other are known as Dynamic Websites The websites with static data (the data in each web page remains unhanged) is called Static Website
  • 20.
    1. GET andPOST methods are used by websites to share user’s data among its web pages. Therefore these methods are used to create dynamic webpages. 2. GET & POST methods are the http request methods used inside <form> tag to send data to the server. Syntax: <form action=“web page address” method=“POST”>
  • 21.
  • 22.
    Activity Write PHP Codeto print area of rectangle on webpage (use POST Method)
  • 23.
    1.PHP-> Scripting Languageto create web applications 2. PHP require a web server 3. GET and POST methods are the HTTP request methods used inside <form> tag to send data to the server. Conclusion: