server side scripting
play

Server-side Scripting Slides courtesy of Xenia Mountrouidou URLs - PowerPoint PPT Presentation

Server-side Scripting Slides courtesy of Xenia Mountrouidou URLs and web servers 2 http://server/path/file Usually when you type a URL in your browser: Your computer looks up the server's IP address using DNS Your browser connects


  1. Server-side Scripting Slides courtesy of Xenia Mountrouidou

  2. URLs and web servers 2 http://server/path/file  Usually when you type a URL in your browser:  Your computer looks up the server's IP address using DNS  Your browser connects to that IP address and requests the given file  The web server software (e.g. Apache) grabs that file from the server's local file system  The server sends back its contents to you

  3. URLs and web servers (cont.) 3 Apache, Websphere (Java Servlets, XML Files) Database Web/Application Server

  4. URLs and web servers (cont.) 4 http:// www.facebook.com/home.php  Some URLs actually specify programs that the web server should run , and then send their output back to you as the result:  The above URL tells the server facebook.com to run the program home.php and send back its output

  5. Server-Side vs. Client-Side Scripting Languages What are they and what are their differences? By Lories Slockbower

  6. Scripting Language  A new style of programming language different from system programming languages  Designed as glue language or system integration language  A single statement can execute huge number of machine instructions  Are normally ‘typeless’  Build complex algorithms and data structures..  Can create dynamic web pages  Change based on user input

  7. Types of Scripting Languages  Server-side Scripting Language  Can use huge resources of the server  Complete all processing in the server and send plain pages to the client  Reduces client-side computation overhead  Client-side Scripting Language  Does not involve server processing  Complete application is downloaded to the client browser  Client browser executes it locally  Are normally used to add functionality to web pages e.g. different menu styles, graphic displays or dynamic advertisements

  8. Different Scripting Languages  Active Server Pages (ASP)  Server side scripting language  Developed by Microsoft  Good at connecting to Microsoft databases  Runs only on Microsoft servers  Perl  Old UNIX language  Found on all Windows and Linux servers  Can handle text manipulation tasks  Excellent web scripting language

  9. Different Scripting Languages  PHP (Hypertext Pre-Processor)  Especially good at connecting to MySQL  Very popular language  Runs on UNIX and Windows  HTML-embedded scripting language  Syntax looks like C, JAVA, and PERL  Generate Dynamic content and good User Interface  Server side execution  JSP (Java Server Pages)  Developed by Sun  Uses Java  Provide server-specific framework like Microsoft’s ASP

  10. Different Scripting Languages  CGI (Common Gateway Interface)  Server-side solution  Needs to launch separate instance of application for each web request  Allows direct interaction with users  ASP.NET  Server-side technology to create faster, reliable and dynamic web pages  Supports .NET framework languages (C#, VB.NET, JScript.NET)  Provides flexibility to designers and developers to work separately

  11. Different Scripting Languages  VBScript  Microsoft’s scripting language  Client side Scripting language  Very easy to learn  Includes the functionality of Visual Basic  JavaScript  Client-side Scripting language  Easy to use programming language  Enhance dynamics and interactive features of a web page  Allows to perform calculation, write interactive games, add special effects, customize graphic selections, create security passwords

  12. Conclusion  Scripting languages make the web development work  Easier  Faster  Best utilization of resources  It is the programmer’s choice which one will suite the best considering  Knowledge  Practice  Resource

  13. What is server-side scripting?  Server-side scripting is a method of programming for the web that runs software on the server rather than the browser or installed plugins to create dynamic web pages.

  14. Server-Side Scripting 14  Server-side pages are programs written using one of many web programming languages/frameworks  examples: PHP , Java/JSP , Ruby on Rails, ASP.NET, Python, Perl

  15. What can server scripts do?  Customize a web page and dynamically change its contents  Respond to queries from users or from HTML forms  Access database and send the information back to the browser

  16. Advantages of server-side scripting  User does not need to download plugins like Java or Flash  User can create one template for the entire website  The site can use a content management system which makes editing simpler.  Generally quicker to load than client-side scripting  User is able to include external files to save coding  Scripts are hidden from view so it’s more secure. Users only see the HTML output.

  17. Disadvantages of server-side scripting  The scripts can be used by attackers to access the server. They do this by changing the URL to something that takes advantage of a hole in security. System administrators must keep all server-side scripting updated and use an application firewall to prevent this.  Scripting software must be installed on the content management system tools in order to store the dynamic data.

  18. Server-side scripting example ASP source: Output result <html>  Hello world! <body> <% response.write("Hello World!")%> </body> </html>

  19. What is client-side scripting language? Client-side scripts are placed within  an HTML document in the user’s web browser rather than the web server to allow greater interactivity in a document. For example – client-side scripting could check the user’ s form for errors before submitting it Enables web pages to change  content according to user input and other variables, including the time of day. Can also be stored in a separate file that is referenced to the documents that use it.

  20. How does it work?  Usually, JavaScript code  Files are first sent to the starts with the tag <script user’s computer by the language="JavaScript"> web server which executes and ends with the tag the script and displays the </script>. document.  The client-side script may also include browser directions based on certain user functions such as clicking buttons.  Frequently, you can see the the source card by viewing the file that contains the script.

  21. Example of client-side scripting  Suppose a person completes a form but omits information. When they slick the submit button, an alert box appears telling them about the mistake.  This is JavaScript and is an example of Client Side Scripting because all the activity takes place inside the browser.

  22. Advantages of client-side scripting  Allows for more interactivity  Can perform actions quickly without going to the server  May be easier to use for those whose browsers don’t support scripts  Are available from many free resources such as Hotscripts.com and Javascript.com

  23. Disadvantages of client-side scripts  If the user’s browser is out of date, the website will not display properly.  More quality assurance testing is required because different browsers support scripts differently  Not secure because anyone can look at the code in the page source  Some browsers will disable the active content and tell the user they may be harmful.

  24. Client-side scripting language  JavaScript – Not to be confused with Java, JavaScript client-side is a programming language is implemented as part of the web browser to enhance dynamic websites  VBScript is a programming language that can manipulate the document objects and the browser

  25. So how to know which to use?  Know your audience – Be sure to know what scripts work best with the browsers your audience will use. JavaScript is most compatible with Microsoft Internet Explorer and Netscape. VBScript usually just works on Internet Explorer.  Test scripts on the browsers for both PC and MAC users as browsers on the MACs don’t support scripts as well as the PC versions do.  Scripts should be tested on at least the previous two versions of your audience’s browser since people are slow to update their browsers so the latest scripts may not work.

  26. Client Side vs. Server Side Web  Simply defined, client-side code executes on the end-user's computer, usually within a web browser.  Server-side code executes on the web server, usually within a web application environment, which in turn generates HTML to be viewed in a browser.

  27. Client Side vs. Server Side Web  Which one to choose? What are the determining factors?  Performance:  Responsiveness, speed, reliability  Ability to handle a large number of simultaneous users  Functionality:  Simplicity of use and maintenance,  Breadth of user options  Ability to handle multiple simultaneous transactions  Security:  Desktop security  Server security  Database security  Network security

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend