SlideShare a Scribd company logo
Web forms and Server
Side Scripting
Sawsan Slii Marzouki
Internet Applicatiosn Development
Server Side Scripting
What is a server?
 Many types of server:
File server
FTP server
Web server
Mail server
News server
Dynamic Interactive Web Server
(3-tier architecture(
General Multi-tier Architecture
Web content
 HTML documents are static
 Dynamic content :
 User side programming (JavaScript, CSS, Ajax,
JQuery……)
 Server side programming (PHP, ASP and ASP.Net,
JSP, Python….)
Why Server Side Programming?
 Accessibility :
Any one can reach Internet.
 Manageability :
Does not require distribution of application code
 Security :
Source code is not exposed
 Scalability : (‫)تطور‬
Web-based 3-tier architecture can scale out
History of web dynamic content
 Common Gateway Interface (CGI) was the
first generation approach to providing
dynamic web content (used scripts)
 Numerous second generation alternatives
were invented (FastCGI, mod_Perl, NSAPI,
ISAPI, Java Servlets…)
 Scripting, the third generation
approach
Scripting, the third generation
approach
 Embed simple code in HTML pages
 The HTML pages use the code to decide what
elements to display and what data should be
displayed.
 Classes and/or subroutines can be called to
compute information for inclusion in the web
page.
 This is know as « scripting ».
Scripting languages or compiled
Scripting languages Compiled languages
Server Side Includes (SSI)
Perl
PHP
ASP (VBScript)
Python
C
C++
ASP.Net
Java Servlet
Java Server Pages
Some approaches to Scripting

JavaServer Pages (JSP) by Sun MicroSystems

Hypertext Preprocessor (PHP): open source
 Cold Fusion (CFML) by Macromedia

Active Server Pages (ASP and ASP.Net) by
MicroSoft
Criteria affecting Scripting choice
 Web Server availability
 Knowledge of language
 Scalability and efficiency
 Personal preference
Learn more about JSP,
PHP and ASP.Net
JSP (Java Server Pages(
 Java-based technology that simplifies the
development of dynamic websites
 Designed around the Java Philosophy
 Packaged with J2EE
 It separates presentation aspects from
programming logic contained in the code.
J2EE Technology
 Web container (application server)
 EJB container
 Servlets : JSP pages running in webServers
 JSP: JavaServer Pages
 Apples, XML, JDBC, …….
Servlets and JSP
JSP Basics
 Individual JSP pages are text files stored on the web
server.
 When a page is first required, then JSP Engine uses
the page to generate a Servlet.
 The compiled Servlet is saved and used to serve
additional requests.
 When a page is modified, the appropriate Servlet is
regenerated.
 Precompilation is also possible
A simple JSP code
 New.java.util.Date().ToString(): creates a date
Object and converts it to a String that can be
displayed
What is PHP?
 Open source Server-Side Scripting language
designed specifically for the web.
 Conceived in 1994.
 Supports a wide-range of databases.
 Perl and C like syntax.
 Designed similar to ASP: you embed
commands into your web pages.
What is PHP?
 Commands are preprocessed by Php
processor and appropriate HTML is sent to
the web server.
 Platoform independant
 Easy to learn
 Usually associated to MySQL database (a
relational free DBMS, can run on Unix,
Windows, and Mac OS).
Php Process Flow
Php first example:
ASP.Net
 Based on .Net Framework and the common
language runtime (CLR)
 Compiled language
 MicroSoft Only Platforms
web forms and Server
Side Scripting
Form processing script
Steps to Form Processing Script
 Creating the HTML code for the form
<form action="myform.php" method="post">
<!-- form fields here -->
</form>
The “action” specifies what page to submit the form to.
The “method” indicates how the form is submitted :Get
and Post.
Most of the time, forms will use the “post” method.
Steps to Form Processing Script
<form action="myform.php" method="post">
Which is your favorite movie?
<input type="text" name="formMovie"
maxlength="50">
<input type="submit" name="formSubmit"
value="Submit">
</form>
Steps to Form Processing Script
 Getting the form data:
The input of type “text” is just a single line field
to type in some text. We give it a name of
“formMovie” .
You have a button submit that submits the whole
form once clicked on.
Steps to Form Processing Script
<?php
if($_POST['formSubmit'] == "Submit")
{
$varMovie = $_POST['formMovie']; }
?>
<form action="myform.php" method="post">
Which is your favorite movie?
<input type="text" name="formMovie" maxlength="50">
<input type="submit" name="formSubmit" value="Submit">
</form>
Steps to Form Processing Script
 Validating the input:
Suppose we have a user who forgot to enter one of the fields?
We need to validate the form to make sure it’s complete and
filled out with valid information.
Steps to Form Processing Script
<?php
if($_POST['formSubmit'] == "Submit")
{
$errorMessage = "";
if(empty($_POST['formMovie']))
{
$errorMessage .= "<li>You forgot to enter a movie!</li>";
}
Steps to Form Processing Script
if(empty($_POST['formName']))
{
$errorMessage .= "<li>You forgot to enter a
name!</li>";
}
$varMovie = $_POST['formMovie'];
$varName = $_POST['formName'];
Steps to Form Processing Script
if(!empty($errorMessage))
{
echo("<p>There was an error with your
form:</p>n");
echo("<ul>" . $errorMessage . "</ul>n");
}
}
?>
PHP: how to connect to
the server?
PHP: How to connect to the
server?
 Option 1: Website on a hosted server
 Option 2: Install PHP on your computer
 Option 3: XAMPP

Website on a hosted server
 Create a file in Notepad (or similar text editor)
named test.php
 Insert the following code in the file:
<?php echo "Hello World!"; ?>
 Upload the file to your web host.
 Open the file in your browser.
 If the browser writes "Hello World!" your web host
supports PHP and you are ready to go. Otherwise
contact your hosting provider for more information.
Install PHP on your computer
 We will learn more about this option in
practice using EasyPhp.
XAMPP
 Open the program XAMPP Control Panel
 Start the Apache server and the MySql server:
 Create a file in Notepad named test.php .
 Insert the following code in the file:
<?php echo "Hello World!"; ?>
 Save the file in the folder "c:xampphtdocs".
 Open the file in your browser with the address
http://localhost/test.php.
 If the browser writes "Hello World!" the installation is
successful, and you're ready to run PHP on your computer.

More Related Content

What's hot

Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
Sander Demeester
 
Book Selling Website Report
Book Selling Website ReportBook Selling Website Report
Book Selling Website Report
Saloni Bajaj
 
Project Planning in Software Engineering
Project Planning in Software EngineeringProject Planning in Software Engineering
Project Planning in Software Engineering
Fáber D. Giraldo
 
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
Mario Heiderich
 
Soft engg introduction and process models
Soft engg introduction and process modelsSoft engg introduction and process models
Soft engg introduction and process models
snehalkulkarni74
 
Create an online bookstore
Create an online bookstoreCreate an online bookstore
Create an online bookstoreJaved Khan
 
Introduction to Software Project Management
Introduction to Software Project ManagementIntroduction to Software Project Management
Introduction to Software Project Management
Reetesh Gupta
 
Cinema management system
Cinema management systemCinema management system
Cinema management system
Sulman Ahmed
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020
Moataz Kamel
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
Narudom Roongsiriwong, CISSP
 
Software Engineering Methodologies
Software Engineering MethodologiesSoftware Engineering Methodologies
Software Engineering MethodologiesDamian T. Gordon
 
9. Software Implementation
9. Software Implementation9. Software Implementation
9. Software Implementation
ghayour abbas
 
An introduction to software engineering
An introduction to software engineeringAn introduction to software engineering
An introduction to software engineering
Carlos Gavidia-Calderon
 
Software development slides
Software development slidesSoftware development slides
Software development slidesiarthur
 
Securing Your API
Securing Your APISecuring Your API
Securing Your API
Jason Austin
 
Software reuse ppt.
Software reuse ppt.Software reuse ppt.
Software reuse ppt.
Sumit Biswas
 
Agile Methodology PPT
Agile Methodology PPTAgile Methodology PPT
Agile Methodology PPT
Mohit Kumar
 
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECTBOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECTRavi Teja P
 
Coding standards
Coding standardsCoding standards
Coding standards
Mimoh Ojha
 

What's hot (20)

Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
 
Book Selling Website Report
Book Selling Website ReportBook Selling Website Report
Book Selling Website Report
 
Project Planning in Software Engineering
Project Planning in Software EngineeringProject Planning in Software Engineering
Project Planning in Software Engineering
 
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
 
Soft engg introduction and process models
Soft engg introduction and process modelsSoft engg introduction and process models
Soft engg introduction and process models
 
Create an online bookstore
Create an online bookstoreCreate an online bookstore
Create an online bookstore
 
Introduction to Software Project Management
Introduction to Software Project ManagementIntroduction to Software Project Management
Introduction to Software Project Management
 
Cinema management system
Cinema management systemCinema management system
Cinema management system
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
 
Software Engineering Methodologies
Software Engineering MethodologiesSoftware Engineering Methodologies
Software Engineering Methodologies
 
online marketplace report
online marketplace reportonline marketplace report
online marketplace report
 
9. Software Implementation
9. Software Implementation9. Software Implementation
9. Software Implementation
 
An introduction to software engineering
An introduction to software engineeringAn introduction to software engineering
An introduction to software engineering
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 
Securing Your API
Securing Your APISecuring Your API
Securing Your API
 
Software reuse ppt.
Software reuse ppt.Software reuse ppt.
Software reuse ppt.
 
Agile Methodology PPT
Agile Methodology PPTAgile Methodology PPT
Agile Methodology PPT
 
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECTBOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
BOOKS FOR CASH ON DELIVERY-INTERNSHIP PROJECT
 
Coding standards
Coding standardsCoding standards
Coding standards
 

Similar to Web forms and server side scripting

An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
jphl
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetAdil Mughal
 
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
Prof Ansari
 
The Functional Web
The Functional WebThe Functional Web
The Functional Web
Ryan Riley
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
bmani
 
My Saminar On Php
My Saminar On PhpMy Saminar On Php
My Saminar On Php
Arjun Kumawat
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
SAMIR BHOGAYTA
 
Web Development Environments: Choose the best or go with the rest
Web Development Environments:  Choose the best or go with the restWeb Development Environments:  Choose the best or go with the rest
Web Development Environments: Choose the best or go with the restgeorge.james
 
Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2jamram82
 
Top 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answersTop 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answers
sonia merchant
 
Top 15 asp dot net interview questions and answers
Top 15 asp dot net interview questions and answersTop 15 asp dot net interview questions and answers
Top 15 asp dot net interview questions and answers
Pooja Gaikwad
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
ASP.NET - Ivan Marković
ASP.NET - Ivan MarkovićASP.NET - Ivan Marković
ASP.NET - Ivan Marković
Software StartUp Academy Osijek
 
PHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHPPHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHP
Lariya Minhaz
 

Similar to Web forms and server side scripting (20)

An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp Net
 
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
 
The Functional Web
The Functional WebThe Functional Web
The Functional Web
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
My Saminar On Php
My Saminar On PhpMy Saminar On Php
My Saminar On Php
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
 
Web Development Environments: Choose the best or go with the rest
Web Development Environments:  Choose the best or go with the restWeb Development Environments:  Choose the best or go with the rest
Web Development Environments: Choose the best or go with the rest
 
Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2
 
Asp.net
Asp.netAsp.net
Asp.net
 
Intro To Asp
Intro To AspIntro To Asp
Intro To Asp
 
Top 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answersTop 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answers
 
Top 15 asp dot net interview questions and answers
Top 15 asp dot net interview questions and answersTop 15 asp dot net interview questions and answers
Top 15 asp dot net interview questions and answers
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
ASP.NET - Ivan Marković
ASP.NET - Ivan MarkovićASP.NET - Ivan Marković
ASP.NET - Ivan Marković
 
Jsp Comparison
 Jsp Comparison Jsp Comparison
Jsp Comparison
 
PHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHPPHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHP
 

More from sawsan slii

Ch1 traditional it and cloud
Ch1 traditional it and cloudCh1 traditional it and cloud
Ch1 traditional it and cloud
sawsan slii
 
Aws principle services: IAM,VPC, EC2, Cloudwatch
Aws principle services: IAM,VPC, EC2, CloudwatchAws principle services: IAM,VPC, EC2, Cloudwatch
Aws principle services: IAM,VPC, EC2, Cloudwatch
sawsan slii
 
Introduction to exploring hci
Introduction to exploring hciIntroduction to exploring hci
Introduction to exploring hci
sawsan slii
 
Design principles
Design principlesDesign principles
Design principles
sawsan slii
 
Introduction hci
Introduction hciIntroduction hci
Introduction hci
sawsan slii
 
Ch1 traditional it and cloud
Ch1 traditional it and cloudCh1 traditional it and cloud
Ch1 traditional it and cloud
sawsan slii
 
Cache mapping exercises
Cache mapping exercisesCache mapping exercises
Cache mapping exercises
sawsan slii
 
Fileprocessing lec-7
Fileprocessing lec-7Fileprocessing lec-7
Fileprocessing lec-7
sawsan slii
 
evaluation techniques in HCI
evaluation techniques in HCIevaluation techniques in HCI
evaluation techniques in HCI
sawsan slii
 
Evaluation techniques in HCI
Evaluation techniques in HCIEvaluation techniques in HCI
Evaluation techniques in HCI
sawsan slii
 
Ajax and xml
Ajax and xmlAjax and xml
Ajax and xml
sawsan slii
 
UCD and low-fidelity prototyping
UCD and low-fidelity prototypingUCD and low-fidelity prototyping
UCD and low-fidelity prototyping
sawsan slii
 
Web server administration
Web server administrationWeb server administration
Web server administration
sawsan slii
 

More from sawsan slii (13)

Ch1 traditional it and cloud
Ch1 traditional it and cloudCh1 traditional it and cloud
Ch1 traditional it and cloud
 
Aws principle services: IAM,VPC, EC2, Cloudwatch
Aws principle services: IAM,VPC, EC2, CloudwatchAws principle services: IAM,VPC, EC2, Cloudwatch
Aws principle services: IAM,VPC, EC2, Cloudwatch
 
Introduction to exploring hci
Introduction to exploring hciIntroduction to exploring hci
Introduction to exploring hci
 
Design principles
Design principlesDesign principles
Design principles
 
Introduction hci
Introduction hciIntroduction hci
Introduction hci
 
Ch1 traditional it and cloud
Ch1 traditional it and cloudCh1 traditional it and cloud
Ch1 traditional it and cloud
 
Cache mapping exercises
Cache mapping exercisesCache mapping exercises
Cache mapping exercises
 
Fileprocessing lec-7
Fileprocessing lec-7Fileprocessing lec-7
Fileprocessing lec-7
 
evaluation techniques in HCI
evaluation techniques in HCIevaluation techniques in HCI
evaluation techniques in HCI
 
Evaluation techniques in HCI
Evaluation techniques in HCIEvaluation techniques in HCI
Evaluation techniques in HCI
 
Ajax and xml
Ajax and xmlAjax and xml
Ajax and xml
 
UCD and low-fidelity prototyping
UCD and low-fidelity prototypingUCD and low-fidelity prototyping
UCD and low-fidelity prototyping
 
Web server administration
Web server administrationWeb server administration
Web server administration
 

Recently uploaded

The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 

Recently uploaded (20)

The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 

Web forms and server side scripting

  • 1. Web forms and Server Side Scripting Sawsan Slii Marzouki Internet Applicatiosn Development
  • 3. What is a server?  Many types of server: File server FTP server Web server Mail server News server
  • 4. Dynamic Interactive Web Server (3-tier architecture(
  • 6. Web content  HTML documents are static  Dynamic content :  User side programming (JavaScript, CSS, Ajax, JQuery……)  Server side programming (PHP, ASP and ASP.Net, JSP, Python….)
  • 7. Why Server Side Programming?  Accessibility : Any one can reach Internet.  Manageability : Does not require distribution of application code  Security : Source code is not exposed  Scalability : (‫)تطور‬ Web-based 3-tier architecture can scale out
  • 8. History of web dynamic content  Common Gateway Interface (CGI) was the first generation approach to providing dynamic web content (used scripts)  Numerous second generation alternatives were invented (FastCGI, mod_Perl, NSAPI, ISAPI, Java Servlets…)  Scripting, the third generation approach
  • 9. Scripting, the third generation approach  Embed simple code in HTML pages  The HTML pages use the code to decide what elements to display and what data should be displayed.  Classes and/or subroutines can be called to compute information for inclusion in the web page.  This is know as « scripting ».
  • 10. Scripting languages or compiled Scripting languages Compiled languages Server Side Includes (SSI) Perl PHP ASP (VBScript) Python C C++ ASP.Net Java Servlet Java Server Pages
  • 11. Some approaches to Scripting  JavaServer Pages (JSP) by Sun MicroSystems  Hypertext Preprocessor (PHP): open source  Cold Fusion (CFML) by Macromedia  Active Server Pages (ASP and ASP.Net) by MicroSoft
  • 12. Criteria affecting Scripting choice  Web Server availability  Knowledge of language  Scalability and efficiency  Personal preference
  • 13. Learn more about JSP, PHP and ASP.Net
  • 14. JSP (Java Server Pages(  Java-based technology that simplifies the development of dynamic websites  Designed around the Java Philosophy  Packaged with J2EE  It separates presentation aspects from programming logic contained in the code.
  • 15. J2EE Technology  Web container (application server)  EJB container  Servlets : JSP pages running in webServers  JSP: JavaServer Pages  Apples, XML, JDBC, …….
  • 17. JSP Basics  Individual JSP pages are text files stored on the web server.  When a page is first required, then JSP Engine uses the page to generate a Servlet.  The compiled Servlet is saved and used to serve additional requests.  When a page is modified, the appropriate Servlet is regenerated.  Precompilation is also possible
  • 18. A simple JSP code  New.java.util.Date().ToString(): creates a date Object and converts it to a String that can be displayed
  • 19. What is PHP?  Open source Server-Side Scripting language designed specifically for the web.  Conceived in 1994.  Supports a wide-range of databases.  Perl and C like syntax.  Designed similar to ASP: you embed commands into your web pages.
  • 20. What is PHP?  Commands are preprocessed by Php processor and appropriate HTML is sent to the web server.  Platoform independant  Easy to learn  Usually associated to MySQL database (a relational free DBMS, can run on Unix, Windows, and Mac OS).
  • 23. ASP.Net  Based on .Net Framework and the common language runtime (CLR)  Compiled language  MicroSoft Only Platforms
  • 24. web forms and Server Side Scripting
  • 26. Steps to Form Processing Script  Creating the HTML code for the form <form action="myform.php" method="post"> <!-- form fields here --> </form> The “action” specifies what page to submit the form to. The “method” indicates how the form is submitted :Get and Post. Most of the time, forms will use the “post” method.
  • 27. Steps to Form Processing Script <form action="myform.php" method="post"> Which is your favorite movie? <input type="text" name="formMovie" maxlength="50"> <input type="submit" name="formSubmit" value="Submit"> </form>
  • 28. Steps to Form Processing Script  Getting the form data: The input of type “text” is just a single line field to type in some text. We give it a name of “formMovie” . You have a button submit that submits the whole form once clicked on.
  • 29. Steps to Form Processing Script <?php if($_POST['formSubmit'] == "Submit") { $varMovie = $_POST['formMovie']; } ?> <form action="myform.php" method="post"> Which is your favorite movie? <input type="text" name="formMovie" maxlength="50"> <input type="submit" name="formSubmit" value="Submit"> </form>
  • 30. Steps to Form Processing Script  Validating the input: Suppose we have a user who forgot to enter one of the fields? We need to validate the form to make sure it’s complete and filled out with valid information.
  • 31. Steps to Form Processing Script <?php if($_POST['formSubmit'] == "Submit") { $errorMessage = ""; if(empty($_POST['formMovie'])) { $errorMessage .= "<li>You forgot to enter a movie!</li>"; }
  • 32. Steps to Form Processing Script if(empty($_POST['formName'])) { $errorMessage .= "<li>You forgot to enter a name!</li>"; } $varMovie = $_POST['formMovie']; $varName = $_POST['formName'];
  • 33. Steps to Form Processing Script if(!empty($errorMessage)) { echo("<p>There was an error with your form:</p>n"); echo("<ul>" . $errorMessage . "</ul>n"); } } ?>
  • 34. PHP: how to connect to the server?
  • 35. PHP: How to connect to the server?  Option 1: Website on a hosted server  Option 2: Install PHP on your computer  Option 3: XAMPP 
  • 36. Website on a hosted server  Create a file in Notepad (or similar text editor) named test.php  Insert the following code in the file: <?php echo "Hello World!"; ?>  Upload the file to your web host.  Open the file in your browser.  If the browser writes "Hello World!" your web host supports PHP and you are ready to go. Otherwise contact your hosting provider for more information.
  • 37. Install PHP on your computer  We will learn more about this option in practice using EasyPhp.
  • 38. XAMPP  Open the program XAMPP Control Panel  Start the Apache server and the MySql server:  Create a file in Notepad named test.php .  Insert the following code in the file: <?php echo "Hello World!"; ?>  Save the file in the folder "c:xampphtdocs".  Open the file in your browser with the address http://localhost/test.php.  If the browser writes "Hello World!" the installation is successful, and you're ready to run PHP on your computer.