SlideShare a Scribd company logo
1 of 31
M D ANANDA RAJ,
Assistant Professor,
Department of computer science
Loyola College, chennai-600 034
profmdloyola@gmail.com
8/3/2017 1
Introduction to
Web Programming using
PHPand MYSQL
Contents
• Introduction
• History
• Important concepts
• Php
• Mysql
• Database concepts
8/3/2017 2
What is Scripting language?
• Scripting language is the one which is used to
develop contents in the web
• Write the code by using predefined tags
<html> contents </html>
• Example :
• HTML, JAVASCRIPT, VBSCRIPT, CSS , XML
8/3/2017 3
What is Client & Server
Client:
client is the system which is looking for
some service
Eg: the system end user using in the lab
Server:
server is the system which is providing
service for the clients (end user)
Eg: server in the computer lab
8/3/2017 4
Client side…
• Client side scripting language executed from
the client machine(System)
example : HTML , CSS, JAVASCRIPT, VBSCRIPT
- Not secured
- any user can view the original by seeing the
view source option in the browser
- any user can view the source code
and modify
8/3/2017 5
Server side …
• Server side scripting language executed from the
server machine(System)
example : ASP , PHP , JSP
- Very much secured
- User cannot view the original source code by
seeing the view source option in the browser it
will show only the html code
- user cannot modify the source code
8/3/2017 6
web contents
• Web can be classified in to two types
1.static page
-contents will not change remain as it is
-user input interaction not possible
2. Dynamic page :
- Contents can be updated very easily
- user input and interaction is possible
8/3/2017 7
What is Open source?
• In software development Open source is the
concept or philosophy that promotes free
distribution of software product without any
license fees.
• Example: open source
• Operating System: Linux
• Script language : PHP,PERL, PYTHON
• Browser : Mozilla Firefox
• Photo Editor : GIMP
• Office : Open Office
8/3/2017 8
Open source development model
View/Modify the source code of an application or software.
he source code of an application or software.
Open source software is released to the development community
and undergoes a secondary phase of evolution, but closed source
software is developed in isolation with a small team of developers.
Developer support and large community to help.
Open Source is more secure and bugs and vulnerabilities are fixed
often.
 source software is released to the development community and
undergoes a secondary phase of evolution, but closed source
software is developed in isolation with a small team of developers.
Developer support and large community to help.
Open Source is more secure and bugs and vulnerabilities are fixed
often.
8/3/2017 9
Advantages…
• Free source code
• No need pay license fees
• No need to depend on vendors
• Easy to fix the error with online support
• Support from forum all around the world
• Updated software version
• Quality and customizable software
• Cost cheaper than licensed software
8/3/2017 10
Disadvantages…
• Users need to update very frequently
• Incompatibility issue with software and
hardware
• Bad codes
• Software quality assurance process is not
transparent
• No financial benefit for the developers
8/3/2017 11
What is wamp?
• WAMP is a web server used to execute php
and mysql in client machine
• A- APACHE
• M- MySQL
• P- PHP
• W- WINDOWS
It is “ APACHE MYSQL PHP FOR WINDOWS
LAMP : APACHE MYSQL PHP FOR LINUX
8/3/2017 12
WAMP ARCHITECTURE…
8/3/2017 13
PHP-Introduction
• PHP == ‘Hypertext Preprocessor’
• Open-source, server-side scripting language
• Used to generate dynamic web-pages
• PHP scripts reside between reserved PHP
tags
– This allows the programmer to embed PHP
scripts within HTML page
– Free to download and use
8/3/2017 14
Overview of PHP…
• Easy learning
• Syntax Perl- and C-like syntax. Relatively easy
to learn.
• Large function library
• Embedded directly into HTML
• Interpreted, no need to compile
• Supports many databases like oracle, MySQL
etc
8/3/2017 15
Php…
• Interpreted language, scripts are parsed at
run-time rather than compiled
• Executed on the server-side
• Source-code not visible by client
– ‘View Source’ in browsers does not display the PHP code
• Various built-in functions allow for fast
development
• Compatible with many popular databases
8/3/2017 16
History of php…
In 1994 developed by Rasmus Lerdorf developed
he called the Personal Home Page or PHP
PHP 2 released 1997 (PHP now stands for
Hypertext Processor)
PHP3 released in 1998 (2 versions)
PHP4 released in 2000 (6 versions).
PHP5.0.0 released July 13, 2004 (1000s of
libraries and functions
PHP5.0.5 released Sept. 6, 2005 for maintenance
and bug fixes (21 versions)
PHP 6.0 is the latest version
8/3/2017 17
Features of php…
• Simplicity
• Portability
• Speed
• Open source
• Extensible
• Database support
8/3/2017 18
Hello.php
• Open the note pad
<html>
<?php
Echo “hello good morning”;
?>
</html>
Save this code as hello.php under
c:wampwwwanandhello.php
8/3/2017 19
Data types supported by PHP:
• Integers 0,1,2,3etc
• Float/ Double – real numbers 0.1, 0.2, 0.3, etc
• String – ‘A’, “Loyola College” etc
• Boolean – True or False
• Array – set of values – {0,1,2,3}or
{0.1,0.2,0.3}or {‘A’, ‘B’, ‘C’} or {“kumar”,
Santhosh”, “Karthick”} etc
8/3/2017 20
Variable declaration
Variables are used for storing values, such as numbers, strings or
function results, so that they can be used many times in a script .All
variables in PHP start with a $ sign symbol.
Syntax:
$var_name = value;
<?php
$txt = "Hello World!";
$number = 16;
?>
Note : PHP a variable does not need to be declared before being
set.PHP automatically converts the variable to the correct data
type, depending on how they are set.
8/3/2017 21
PHP Variable….
• PHP variables must begin with a “$” sign
• Case-sensitive ($Name != $NAME != $NaMe)
• Global and locally-scoped variables
– Global variables can be used anywhere
– Local variables restricted to a function or class
• Certain variable names reserved by PHP
– Form variables ($_POST, $_GET)
– Server variables ($_SERVER)
– Etc.
8/3/2017 22
constants
• PHP constants: Constants are like variables
except that once they are defined they cannot
be changed or undefined. The value cannot be
changed during the script.
• Eg:
<?php
define("MSG", “good morning");
echo MSG;
?>
8/3/2017 23
Looping
• Most of the time when we write code, we want the same
block of code to run a number of times for this purpose we
can use looping statements code to perform this task.
• PHP supports the following:
• while - loops through a block of code if and as long as a
specified condition is true
• do...while - loops through a block of code once, and then
repeats the loop as long as a special condition is true
• for - loops through a block of code a specified number of
times
• foreach- loops through a block of code for each element in
an array
8/3/2017 24
Example for each
• Example:
<?php
$arr=array("one", "two", "three");
foreach ($arr as $value)
{
echo "Value: " . $value . "<br />";
?>
8/3/2017 25
cookies
• A cookie is often used to identify a user. A
cookie is a small file that the server embeds
on the user's computer.
• Each time the same computer requests a
page with a browser, it will send the cookie
too.
• With PHP, you can both create and retrieve
cookie values.
8/3/2017 26
What is a PHP Session?
• When you work with an application, you open it, do
some changes, and then you close it. This is much like a
Session. The computer knows who you are. It knows
when you start the application and when you end
• Session variables solve this problem by storing user
information to be used across multiple pages (e.g.
username, password etc). By default, session variables
last until the user closes the browser.
• Session variables hold information about one single
user, and are available to all pages in one application.
8/3/2017 27
MySQL…
MySQL, the most popular Open Source SQL database
management system
It is developed and supported by MySQL AB. MySQL AB is a
commercial company, founded in 1995 by the MySQL
developers.
The MySQL® software delivers a very fast, multi-threaded,
multi-user, and robust SQL (Structured Query Language)
database server.
The MySQL software is Dual Licensed. Users can choose to
use the MySQL software as an Open Source product and
also as commericial licence
8/3/2017 28
MySQL…
• MySQL is a very popular, open source
database.
• Officially pronounced “my Ess Que Ell” (not
my sequel).
• Handles very large databases; very fast
performance.
8/3/2017 29
MySQL storage engines…
• MyISAM –default engine
• InnoDB – features like foreign key,locking
• MERGE – integration of table
• MEMORY (HEAP) – suit for short time storage
• BDB (BerkeleyDB)- hash based storage
• EXAMPLE – used for programmers
• ARCHIVE –to store large amount of data
• CSV – to store data in text files
• BLACKHOLE –only for testing purpose
• ISAM – to store non transactional tables
8/3/2017 30
THANK YOU8/3/2017 31

More Related Content

Similar to Introduction to webprogramming using PHP and MySQL

Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1ADARSH BHATT
 
Web programming
Web programmingWeb programming
Web programmingIshucs
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar litbbsr
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar litbbsr
 
main report on restaurant
main report on restaurantmain report on restaurant
main report on restaurantNeeraj Kumar
 
An Introduction to Open Source Software and Web Application Development
An Introduction to Open Source Software and Web Application DevelopmentAn Introduction to Open Source Software and Web Application Development
An Introduction to Open Source Software and Web Application Developmenttrevorthornton
 
PhP Training Institute In Delhi
PhP Training Institute In DelhiPhP Training Institute In Delhi
PhP Training Institute In DelhiDivyaSharma84779
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPAGil Fink
 

Similar to Introduction to webprogramming using PHP and MySQL (20)

Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
 
Php unit i
Php unit i Php unit i
Php unit i
 
Php reports sumit
Php reports sumitPhp reports sumit
Php reports sumit
 
Web programming
Web programmingWeb programming
Web programming
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
 
Php
PhpPhp
Php
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
main report on restaurant
main report on restaurantmain report on restaurant
main report on restaurant
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
How PHP works
How PHP works How PHP works
How PHP works
 
An Introduction to Open Source Software and Web Application Development
An Introduction to Open Source Software and Web Application DevelopmentAn Introduction to Open Source Software and Web Application Development
An Introduction to Open Source Software and Web Application Development
 
Php verses .net
Php verses .netPhp verses .net
Php verses .net
 
PhP Training Institute In Delhi
PhP Training Institute In DelhiPhP Training Institute In Delhi
PhP Training Institute In Delhi
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
 

Recently uploaded

GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 

Recently uploaded (20)

GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 

Introduction to webprogramming using PHP and MySQL

  • 1. M D ANANDA RAJ, Assistant Professor, Department of computer science Loyola College, chennai-600 034 profmdloyola@gmail.com 8/3/2017 1 Introduction to Web Programming using PHPand MYSQL
  • 2. Contents • Introduction • History • Important concepts • Php • Mysql • Database concepts 8/3/2017 2
  • 3. What is Scripting language? • Scripting language is the one which is used to develop contents in the web • Write the code by using predefined tags <html> contents </html> • Example : • HTML, JAVASCRIPT, VBSCRIPT, CSS , XML 8/3/2017 3
  • 4. What is Client & Server Client: client is the system which is looking for some service Eg: the system end user using in the lab Server: server is the system which is providing service for the clients (end user) Eg: server in the computer lab 8/3/2017 4
  • 5. Client side… • Client side scripting language executed from the client machine(System) example : HTML , CSS, JAVASCRIPT, VBSCRIPT - Not secured - any user can view the original by seeing the view source option in the browser - any user can view the source code and modify 8/3/2017 5
  • 6. Server side … • Server side scripting language executed from the server machine(System) example : ASP , PHP , JSP - Very much secured - User cannot view the original source code by seeing the view source option in the browser it will show only the html code - user cannot modify the source code 8/3/2017 6
  • 7. web contents • Web can be classified in to two types 1.static page -contents will not change remain as it is -user input interaction not possible 2. Dynamic page : - Contents can be updated very easily - user input and interaction is possible 8/3/2017 7
  • 8. What is Open source? • In software development Open source is the concept or philosophy that promotes free distribution of software product without any license fees. • Example: open source • Operating System: Linux • Script language : PHP,PERL, PYTHON • Browser : Mozilla Firefox • Photo Editor : GIMP • Office : Open Office 8/3/2017 8
  • 9. Open source development model View/Modify the source code of an application or software. he source code of an application or software. Open source software is released to the development community and undergoes a secondary phase of evolution, but closed source software is developed in isolation with a small team of developers. Developer support and large community to help. Open Source is more secure and bugs and vulnerabilities are fixed often.  source software is released to the development community and undergoes a secondary phase of evolution, but closed source software is developed in isolation with a small team of developers. Developer support and large community to help. Open Source is more secure and bugs and vulnerabilities are fixed often. 8/3/2017 9
  • 10. Advantages… • Free source code • No need pay license fees • No need to depend on vendors • Easy to fix the error with online support • Support from forum all around the world • Updated software version • Quality and customizable software • Cost cheaper than licensed software 8/3/2017 10
  • 11. Disadvantages… • Users need to update very frequently • Incompatibility issue with software and hardware • Bad codes • Software quality assurance process is not transparent • No financial benefit for the developers 8/3/2017 11
  • 12. What is wamp? • WAMP is a web server used to execute php and mysql in client machine • A- APACHE • M- MySQL • P- PHP • W- WINDOWS It is “ APACHE MYSQL PHP FOR WINDOWS LAMP : APACHE MYSQL PHP FOR LINUX 8/3/2017 12
  • 14. PHP-Introduction • PHP == ‘Hypertext Preprocessor’ • Open-source, server-side scripting language • Used to generate dynamic web-pages • PHP scripts reside between reserved PHP tags – This allows the programmer to embed PHP scripts within HTML page – Free to download and use 8/3/2017 14
  • 15. Overview of PHP… • Easy learning • Syntax Perl- and C-like syntax. Relatively easy to learn. • Large function library • Embedded directly into HTML • Interpreted, no need to compile • Supports many databases like oracle, MySQL etc 8/3/2017 15
  • 16. Php… • Interpreted language, scripts are parsed at run-time rather than compiled • Executed on the server-side • Source-code not visible by client – ‘View Source’ in browsers does not display the PHP code • Various built-in functions allow for fast development • Compatible with many popular databases 8/3/2017 16
  • 17. History of php… In 1994 developed by Rasmus Lerdorf developed he called the Personal Home Page or PHP PHP 2 released 1997 (PHP now stands for Hypertext Processor) PHP3 released in 1998 (2 versions) PHP4 released in 2000 (6 versions). PHP5.0.0 released July 13, 2004 (1000s of libraries and functions PHP5.0.5 released Sept. 6, 2005 for maintenance and bug fixes (21 versions) PHP 6.0 is the latest version 8/3/2017 17
  • 18. Features of php… • Simplicity • Portability • Speed • Open source • Extensible • Database support 8/3/2017 18
  • 19. Hello.php • Open the note pad <html> <?php Echo “hello good morning”; ?> </html> Save this code as hello.php under c:wampwwwanandhello.php 8/3/2017 19
  • 20. Data types supported by PHP: • Integers 0,1,2,3etc • Float/ Double – real numbers 0.1, 0.2, 0.3, etc • String – ‘A’, “Loyola College” etc • Boolean – True or False • Array – set of values – {0,1,2,3}or {0.1,0.2,0.3}or {‘A’, ‘B’, ‘C’} or {“kumar”, Santhosh”, “Karthick”} etc 8/3/2017 20
  • 21. Variable declaration Variables are used for storing values, such as numbers, strings or function results, so that they can be used many times in a script .All variables in PHP start with a $ sign symbol. Syntax: $var_name = value; <?php $txt = "Hello World!"; $number = 16; ?> Note : PHP a variable does not need to be declared before being set.PHP automatically converts the variable to the correct data type, depending on how they are set. 8/3/2017 21
  • 22. PHP Variable…. • PHP variables must begin with a “$” sign • Case-sensitive ($Name != $NAME != $NaMe) • Global and locally-scoped variables – Global variables can be used anywhere – Local variables restricted to a function or class • Certain variable names reserved by PHP – Form variables ($_POST, $_GET) – Server variables ($_SERVER) – Etc. 8/3/2017 22
  • 23. constants • PHP constants: Constants are like variables except that once they are defined they cannot be changed or undefined. The value cannot be changed during the script. • Eg: <?php define("MSG", “good morning"); echo MSG; ?> 8/3/2017 23
  • 24. Looping • Most of the time when we write code, we want the same block of code to run a number of times for this purpose we can use looping statements code to perform this task. • PHP supports the following: • while - loops through a block of code if and as long as a specified condition is true • do...while - loops through a block of code once, and then repeats the loop as long as a special condition is true • for - loops through a block of code a specified number of times • foreach- loops through a block of code for each element in an array 8/3/2017 24
  • 25. Example for each • Example: <?php $arr=array("one", "two", "three"); foreach ($arr as $value) { echo "Value: " . $value . "<br />"; ?> 8/3/2017 25
  • 26. cookies • A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. • Each time the same computer requests a page with a browser, it will send the cookie too. • With PHP, you can both create and retrieve cookie values. 8/3/2017 26
  • 27. What is a PHP Session? • When you work with an application, you open it, do some changes, and then you close it. This is much like a Session. The computer knows who you are. It knows when you start the application and when you end • Session variables solve this problem by storing user information to be used across multiple pages (e.g. username, password etc). By default, session variables last until the user closes the browser. • Session variables hold information about one single user, and are available to all pages in one application. 8/3/2017 27
  • 28. MySQL… MySQL, the most popular Open Source SQL database management system It is developed and supported by MySQL AB. MySQL AB is a commercial company, founded in 1995 by the MySQL developers. The MySQL® software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. The MySQL software is Dual Licensed. Users can choose to use the MySQL software as an Open Source product and also as commericial licence 8/3/2017 28
  • 29. MySQL… • MySQL is a very popular, open source database. • Officially pronounced “my Ess Que Ell” (not my sequel). • Handles very large databases; very fast performance. 8/3/2017 29
  • 30. MySQL storage engines… • MyISAM –default engine • InnoDB – features like foreign key,locking • MERGE – integration of table • MEMORY (HEAP) – suit for short time storage • BDB (BerkeleyDB)- hash based storage • EXAMPLE – used for programmers • ARCHIVE –to store large amount of data • CSV – to store data in text files • BLACKHOLE –only for testing purpose • ISAM – to store non transactional tables 8/3/2017 30