Download presentation
Presentation is loading. Please wait.
Published byCarmella Morgan Modified over 9 years ago
1
Server Side Scripting Norman White
2
Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run under the browser) Server side – CGI program Send form information to a program running on a server. Server CGI program sends results back as HTML (or some other browser supported format) Popular CGI languages are perl, python, java, C, C++, … – HTML with embedded code (Server side scripts) PhP, ASP, Cold Fusion, JSP (Java Server Pages), javascript In this case, the embedded code is executed as the web server sends the page out, not when the web browser goes to display the page.
3
Advantages of Server Side Scripting over CGI No need to have CGI program generate the HTML. HTML automatically sent to the browser Developer only needs to add code for server side processing like data base access etc. Much less code to write, easier to debug, etc. 3 Common environments, PHP, ASP, JSP – PHP uses a C syntax – ASP (Active Server Pages) is visual basic – JSP (Java Server Pages) is Java syntax – Can also do server side javascript
4
Embedded Scripts (Scriptlets) Scripting statements are enclosed in script tags. – PhP – ASP, JSP ASP uses Visual Basic for Scripting,
5
ASP Example Static Page
6
Dynamic Page Page is generated by ASP engine which executes scriptlet statements as they are encountered.
7
PhP Examples Hello World in PHP <? // Hello world in PHP print("Hello World"); ?>
8
How do we tell server that we have server side scripting? Name the file.php,.asp,.jsp,.cfm Note, the web server has to be configured to invoke the correct script interpreter. Not all web servers support all scripting languages. – Microsoft supports ASP, can add PhP – Apache supports Php – Tomcat (a java based server) supports JSP.
9
Who does what where? As a test of your understanding, how could you answer the following question. Assuming the user and the web server are in the same time zone, and have synchronized time, how long (milliseconds) does it take to download a simple web page? Could you create a web page that answers this question using PHP? How hard is it? What do you need to know?
10
Team question In 5 minutes, sketch an answer to the previous question.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.