SlideShare a Scribd company logo
1 of 18
Server-Side Scripting
Session 18
• In order to generate dynamic pages we use a server-
side scripting language.
• There are different types of server-side scripting
languages such as PHP, ASP,ASP.NET, ColdFusion, JSP,
Perl and others.
• Each scripting languages is being interpreted by an
application.
• The application which interprets the server-side
script is installed on the sever just like any other
application.
• PHP uses apache which comes with XAMPP & WAMP
• Server-side scripting languages are also operating
systems dependent.
• Each server-side scripting languages supports
basic programming concepts such as variables,
arrays, functions, loops, conditional statement and
others.
• They also contain more specific elements such as
special objects, commands used to communicate
with the server and a database and much more.
• When there is a need to store and retrieve
information (user names, items in stock etc.) a
database will be used to contain the data.
• Sever-side script can communicate to a database
using a structured query language (SQL) which
manipulates the database (add, remove, update
etc.)
• More on that next week.
Three Tier Web
Applications
PHP - Hypertext Preprocessor
In 1994 he created
the PHP scripting language,
authoring the first two
versions of the language
Some really large PHP websites
• Facebook
• Wikipedia
• Flickr
• Yahoo! Answers
• Yahoo! Bookmarks
• SourceForge
• Photobucket
• YouTube
Rasmus Lerdorf
(born 22 November 1968)
• You cannot view the PHP source code by selecting
"View source" in the browser – you will only see
the output from the PHP file, which is plain HTML.
• This is because the scripts are executed on the
server before the result is sent back to the
browser.
• A PHP scripting block always starts with <?php and
ends with ?>.
• A PHP scripting block can be placed anywhere in
the document.
• On servers with shorthand support enabled you
can start a scripting block with <?
• and end with ?>.
• However, for maximum compatibility, we
recommend that you use the standard form
(<?php) rather than the shorthand form.
• A PHP file normally contains HTML tags, just like
an HTML file, and some PHP scripting code.
• Each code line in PHP must end with a semicolon.
The semicolon is a separator and
• is used to distinguish one set of instructions from
another.
• There are two basic statements to output text
with PHP: echo and print. In the
• example above we have used the echo statement
to output the text "Hello World".
• Variables are used for storing a values, like text
strings, numbers or arrays.
• When a variable is set it can be used over and
over again in your script
• All variables in PHP start with a $ sign symbol.
• The correct way of setting a variable in PHP:
$var_name = value;
• In PHP a variable does not need to be declared
before being set.
• In the previous example, you see that you do not
have to tell PHP which data type the variable is.
• PHP automatically converts the variable to the
correct data type, depending on how they are
set.
• In a strongly typed programming language, you
have to declare (define) the type and name of
the variable before using it.
• In PHP the variable is declared automatically
when you use it.
• A variable name must start with a letter or an
underscore "_"
• A variable name can only contain alpha-numeric
characters and underscores (a-Z, 0-9, and _ )
• A variable name should not contain spaces.
• If a variable name is more than one word, it
should be separated with underscore
($my_string), or with capitalization ($myString)
• Very often when you write code, you want to
perform different actions for different decisions.
• You can use conditional statements in your code
to do this.
If (condition)
…code1
Else
…code 2
• If you want to select one of many blocks of code
to be executed, use the Switch statement.
• The switch statement is used to avoid long blocks
of if..elseif..else code.
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;
}
for(initialization; test_condition;loop_update)
{
statement(s)
}
• The test_condition uses relational and logical
operators (<,>,>=,<, &&, ||, etc).
• It is checked at the end of each iteration of the
loop.
• If the condition is still true then another iteration
of the loop is undertaken
The While Loop -Syntax
while (condition=TRUE)
{
statement(s)
}
• The lines of code within {} brackets are repeated as
long as the condition specified in the while statement
is TRUE.
• The condition is checked BEFORE each iteration of
the loop.
• The actual condition can be a single condition or a
logical combination of individual conditions (using
logical operators - &&, || or !).
The Do While Loop - Syntax
do
{
//statement(s);
} while (condition=TRUE);
• Statement(s) is/are executed, and condition is
evaluated if the value of condition is TRUE, then control
passes back to the beginning of the do statement, and
the process repeats itself.
• When condition is FALSE, then control passes to next
statement bellow the loop block.

More Related Content

Similar to PPT 19.pptx

1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_masterjeeva indra
 
Introduction to php contains basic....pptx
Introduction to php contains basic....pptxIntroduction to php contains basic....pptx
Introduction to php contains basic....pptxRanjithaGowda63
 
Php tutorial from_beginner_to_master
Php tutorial from_beginner_to_masterPhp tutorial from_beginner_to_master
Php tutorial from_beginner_to_masterPrinceGuru MS
 
PHP MATERIAL
PHP MATERIALPHP MATERIAL
PHP MATERIALzatax
 
Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1Mohd Harris Ahmad Jaal
 
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 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 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
 
Lecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdfLecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdfShaimaaMohamedGalal
 

Similar to PPT 19.pptx (20)

Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master
 
Php basics
Php basicsPhp basics
Php basics
 
Php Basics
Php BasicsPhp Basics
Php Basics
 
php basics
php basicsphp basics
php basics
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Introduction to php contains basic....pptx
Introduction to php contains basic....pptxIntroduction to php contains basic....pptx
Introduction to php contains basic....pptx
 
Php tutorial from_beginner_to_master
Php tutorial from_beginner_to_masterPhp tutorial from_beginner_to_master
Php tutorial from_beginner_to_master
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
PHP MATERIAL
PHP MATERIALPHP MATERIAL
PHP MATERIAL
 
Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1
 
Php unit i
Php unit iPhp unit i
Php unit i
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Prersentation
PrersentationPrersentation
Prersentation
 
Php
PhpPhp
Php
 
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
 
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 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 Basic & Variables
PHP Basic & VariablesPHP Basic & Variables
PHP Basic & Variables
 
Lecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdfLecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdf
 

More from DrRavneetSingh (10)

CCS PPT 10.pptx
CCS PPT 10.pptxCCS PPT 10.pptx
CCS PPT 10.pptx
 
ppt 17 18.pptx
ppt 17 18.pptxppt 17 18.pptx
ppt 17 18.pptx
 
CSC PPT 13.pptx
CSC PPT 13.pptxCSC PPT 13.pptx
CSC PPT 13.pptx
 
CSC PPT 12.pptx
CSC PPT 12.pptxCSC PPT 12.pptx
CSC PPT 12.pptx
 
CSC PPT 11.pptx
CSC PPT 11.pptxCSC PPT 11.pptx
CSC PPT 11.pptx
 
CSC PPT 9.pptx
CSC PPT 9.pptxCSC PPT 9.pptx
CSC PPT 9.pptx
 
CSC PPT 5.pptx
CSC PPT 5.pptxCSC PPT 5.pptx
CSC PPT 5.pptx
 
CSC PPT 4.pptx
CSC PPT 4.pptxCSC PPT 4.pptx
CSC PPT 4.pptx
 
CSC PPT 3.pptx
CSC PPT 3.pptxCSC PPT 3.pptx
CSC PPT 3.pptx
 
CSC PPT 1.pptx
CSC PPT 1.pptxCSC PPT 1.pptx
CSC PPT 1.pptx
 

Recently uploaded

VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...Call Girls in Nagpur High Profile
 
VIP Call Girl Bikaner Aashi 8250192130 Independent Escort Service Bikaner
VIP Call Girl Bikaner Aashi 8250192130 Independent Escort Service BikanerVIP Call Girl Bikaner Aashi 8250192130 Independent Escort Service Bikaner
VIP Call Girl Bikaner Aashi 8250192130 Independent Escort Service BikanerSuhani Kapoor
 
Jp Nagar Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Jp Nagar Call Girls Bangalore WhatsApp 8250192130 High Profile ServiceJp Nagar Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Jp Nagar Call Girls Bangalore WhatsApp 8250192130 High Profile ServiceHigh Profile Call Girls
 
NO1 Trending kala jadu karne wale ka contact number kala jadu karne wale baba...
NO1 Trending kala jadu karne wale ka contact number kala jadu karne wale baba...NO1 Trending kala jadu karne wale ka contact number kala jadu karne wale baba...
NO1 Trending kala jadu karne wale ka contact number kala jadu karne wale baba...Amil baba
 
The Most Attractive Pune Call Girls Shikrapur 8250192130 Will You Miss This C...
The Most Attractive Pune Call Girls Shikrapur 8250192130 Will You Miss This C...The Most Attractive Pune Call Girls Shikrapur 8250192130 Will You Miss This C...
The Most Attractive Pune Call Girls Shikrapur 8250192130 Will You Miss This C...ranjana rawat
 
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service NashikRussian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashikranjana rawat
 
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...ranjana rawat
 
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...ranjana rawat
 
(ASHA) Sb Road Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(ASHA) Sb Road Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(ASHA) Sb Road Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(ASHA) Sb Road Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Call Girl Nashik Khushi 7001305949 Independent Escort Service Nashik
Call Girl Nashik Khushi 7001305949 Independent Escort Service NashikCall Girl Nashik Khushi 7001305949 Independent Escort Service Nashik
Call Girl Nashik Khushi 7001305949 Independent Escort Service Nashikranjana rawat
 
Top Rated Pune Call Girls Yashwant Nagar ⟟ 6297143586 ⟟ Call Me For Genuine ...
Top Rated  Pune Call Girls Yashwant Nagar ⟟ 6297143586 ⟟ Call Me For Genuine ...Top Rated  Pune Call Girls Yashwant Nagar ⟟ 6297143586 ⟟ Call Me For Genuine ...
Top Rated Pune Call Girls Yashwant Nagar ⟟ 6297143586 ⟟ Call Me For Genuine ...Call Girls in Nagpur High Profile
 
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...Pooja Nehwal
 
Dubai Call Girls Drilled O525547819 Call Girls Dubai (Raphie)
Dubai Call Girls Drilled O525547819 Call Girls Dubai (Raphie)Dubai Call Girls Drilled O525547819 Call Girls Dubai (Raphie)
Dubai Call Girls Drilled O525547819 Call Girls Dubai (Raphie)kojalkojal131
 
VVIP Pune Call Girls Sinhagad Road (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Sinhagad Road (7001035870) Pune Escorts Nearby with Comp...VVIP Pune Call Girls Sinhagad Road (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Sinhagad Road (7001035870) Pune Escorts Nearby with Comp...Call Girls in Nagpur High Profile
 
Vikas Nagar #Dating Call Girls Lucknow Get 50% Off On VIP Escorts Service 🍇 8...
Vikas Nagar #Dating Call Girls Lucknow Get 50% Off On VIP Escorts Service 🍇 8...Vikas Nagar #Dating Call Girls Lucknow Get 50% Off On VIP Escorts Service 🍇 8...
Vikas Nagar #Dating Call Girls Lucknow Get 50% Off On VIP Escorts Service 🍇 8...akbard9823
 
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130Suhani Kapoor
 
4th QT WEEK 2 Cook Meat Cuts part 2.pptx
4th QT WEEK 2 Cook Meat Cuts part 2.pptx4th QT WEEK 2 Cook Meat Cuts part 2.pptx
4th QT WEEK 2 Cook Meat Cuts part 2.pptxKattieAlisonMacatugg1
 
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service NashikHigh Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashikranjana rawat
 
Call Girls Dubai &ubble O525547819 Call Girls In Dubai Blastcum
Call Girls Dubai &ubble O525547819 Call Girls In Dubai BlastcumCall Girls Dubai &ubble O525547819 Call Girls In Dubai Blastcum
Call Girls Dubai &ubble O525547819 Call Girls In Dubai Blastcumkojalkojal131
 

Recently uploaded (20)

VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
 
VIP Call Girl Bikaner Aashi 8250192130 Independent Escort Service Bikaner
VIP Call Girl Bikaner Aashi 8250192130 Independent Escort Service BikanerVIP Call Girl Bikaner Aashi 8250192130 Independent Escort Service Bikaner
VIP Call Girl Bikaner Aashi 8250192130 Independent Escort Service Bikaner
 
Jp Nagar Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Jp Nagar Call Girls Bangalore WhatsApp 8250192130 High Profile ServiceJp Nagar Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Jp Nagar Call Girls Bangalore WhatsApp 8250192130 High Profile Service
 
NO1 Trending kala jadu karne wale ka contact number kala jadu karne wale baba...
NO1 Trending kala jadu karne wale ka contact number kala jadu karne wale baba...NO1 Trending kala jadu karne wale ka contact number kala jadu karne wale baba...
NO1 Trending kala jadu karne wale ka contact number kala jadu karne wale baba...
 
The Most Attractive Pune Call Girls Shikrapur 8250192130 Will You Miss This C...
The Most Attractive Pune Call Girls Shikrapur 8250192130 Will You Miss This C...The Most Attractive Pune Call Girls Shikrapur 8250192130 Will You Miss This C...
The Most Attractive Pune Call Girls Shikrapur 8250192130 Will You Miss This C...
 
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
 
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service NashikRussian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
 
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
 
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
 
(ASHA) Sb Road Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(ASHA) Sb Road Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(ASHA) Sb Road Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(ASHA) Sb Road Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call Girl Nashik Khushi 7001305949 Independent Escort Service Nashik
Call Girl Nashik Khushi 7001305949 Independent Escort Service NashikCall Girl Nashik Khushi 7001305949 Independent Escort Service Nashik
Call Girl Nashik Khushi 7001305949 Independent Escort Service Nashik
 
Top Rated Pune Call Girls Yashwant Nagar ⟟ 6297143586 ⟟ Call Me For Genuine ...
Top Rated  Pune Call Girls Yashwant Nagar ⟟ 6297143586 ⟟ Call Me For Genuine ...Top Rated  Pune Call Girls Yashwant Nagar ⟟ 6297143586 ⟟ Call Me For Genuine ...
Top Rated Pune Call Girls Yashwant Nagar ⟟ 6297143586 ⟟ Call Me For Genuine ...
 
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
 
Dubai Call Girls Drilled O525547819 Call Girls Dubai (Raphie)
Dubai Call Girls Drilled O525547819 Call Girls Dubai (Raphie)Dubai Call Girls Drilled O525547819 Call Girls Dubai (Raphie)
Dubai Call Girls Drilled O525547819 Call Girls Dubai (Raphie)
 
VVIP Pune Call Girls Sinhagad Road (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Sinhagad Road (7001035870) Pune Escorts Nearby with Comp...VVIP Pune Call Girls Sinhagad Road (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Sinhagad Road (7001035870) Pune Escorts Nearby with Comp...
 
Vikas Nagar #Dating Call Girls Lucknow Get 50% Off On VIP Escorts Service 🍇 8...
Vikas Nagar #Dating Call Girls Lucknow Get 50% Off On VIP Escorts Service 🍇 8...Vikas Nagar #Dating Call Girls Lucknow Get 50% Off On VIP Escorts Service 🍇 8...
Vikas Nagar #Dating Call Girls Lucknow Get 50% Off On VIP Escorts Service 🍇 8...
 
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
 
4th QT WEEK 2 Cook Meat Cuts part 2.pptx
4th QT WEEK 2 Cook Meat Cuts part 2.pptx4th QT WEEK 2 Cook Meat Cuts part 2.pptx
4th QT WEEK 2 Cook Meat Cuts part 2.pptx
 
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service NashikHigh Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
 
Call Girls Dubai &ubble O525547819 Call Girls In Dubai Blastcum
Call Girls Dubai &ubble O525547819 Call Girls In Dubai BlastcumCall Girls Dubai &ubble O525547819 Call Girls In Dubai Blastcum
Call Girls Dubai &ubble O525547819 Call Girls In Dubai Blastcum
 

PPT 19.pptx

  • 2. • In order to generate dynamic pages we use a server- side scripting language. • There are different types of server-side scripting languages such as PHP, ASP,ASP.NET, ColdFusion, JSP, Perl and others. • Each scripting languages is being interpreted by an application. • The application which interprets the server-side script is installed on the sever just like any other application. • PHP uses apache which comes with XAMPP & WAMP
  • 3. • Server-side scripting languages are also operating systems dependent. • Each server-side scripting languages supports basic programming concepts such as variables, arrays, functions, loops, conditional statement and others. • They also contain more specific elements such as special objects, commands used to communicate with the server and a database and much more.
  • 4. • When there is a need to store and retrieve information (user names, items in stock etc.) a database will be used to contain the data. • Sever-side script can communicate to a database using a structured query language (SQL) which manipulates the database (add, remove, update etc.) • More on that next week.
  • 6. PHP - Hypertext Preprocessor In 1994 he created the PHP scripting language, authoring the first two versions of the language Some really large PHP websites • Facebook • Wikipedia • Flickr • Yahoo! Answers • Yahoo! Bookmarks • SourceForge • Photobucket • YouTube Rasmus Lerdorf (born 22 November 1968)
  • 7. • You cannot view the PHP source code by selecting "View source" in the browser – you will only see the output from the PHP file, which is plain HTML. • This is because the scripts are executed on the server before the result is sent back to the browser. • A PHP scripting block always starts with <?php and ends with ?>. • A PHP scripting block can be placed anywhere in the document.
  • 8. • On servers with shorthand support enabled you can start a scripting block with <? • and end with ?>. • However, for maximum compatibility, we recommend that you use the standard form (<?php) rather than the shorthand form. • A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code.
  • 9. • Each code line in PHP must end with a semicolon. The semicolon is a separator and • is used to distinguish one set of instructions from another. • There are two basic statements to output text with PHP: echo and print. In the • example above we have used the echo statement to output the text "Hello World".
  • 10. • Variables are used for storing a values, like text strings, numbers or arrays. • When a variable is set it can be used over and over again in your script • All variables in PHP start with a $ sign symbol. • The correct way of setting a variable in PHP: $var_name = value;
  • 11. • In PHP a variable does not need to be declared before being set. • In the previous example, you see that you do not have to tell PHP which data type the variable is. • PHP automatically converts the variable to the correct data type, depending on how they are set. • In a strongly typed programming language, you have to declare (define) the type and name of the variable before using it. • In PHP the variable is declared automatically when you use it.
  • 12. • A variable name must start with a letter or an underscore "_" • A variable name can only contain alpha-numeric characters and underscores (a-Z, 0-9, and _ ) • A variable name should not contain spaces. • If a variable name is more than one word, it should be separated with underscore ($my_string), or with capitalization ($myString)
  • 13. • Very often when you write code, you want to perform different actions for different decisions. • You can use conditional statements in your code to do this. If (condition) …code1 Else …code 2
  • 14. • If you want to select one of many blocks of code to be executed, use the Switch statement. • The switch statement is used to avoid long blocks of if..elseif..else code.
  • 15. 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; }
  • 16. for(initialization; test_condition;loop_update) { statement(s) } • The test_condition uses relational and logical operators (<,>,>=,<, &&, ||, etc). • It is checked at the end of each iteration of the loop. • If the condition is still true then another iteration of the loop is undertaken
  • 17. The While Loop -Syntax while (condition=TRUE) { statement(s) } • The lines of code within {} brackets are repeated as long as the condition specified in the while statement is TRUE. • The condition is checked BEFORE each iteration of the loop. • The actual condition can be a single condition or a logical combination of individual conditions (using logical operators - &&, || or !).
  • 18. The Do While Loop - Syntax do { //statement(s); } while (condition=TRUE); • Statement(s) is/are executed, and condition is evaluated if the value of condition is TRUE, then control passes back to the beginning of the do statement, and the process repeats itself. • When condition is FALSE, then control passes to next statement bellow the loop block.