1 / 32

Dynamic Web Pages

Dynamic Web Pages. Brad Polzar March 8, 2007. Outline . What are Dynamic Web Pages? Server Side Dynamics Active Server Pages Hypertext Preprocessor Client Side Dynamics JavaScript Java Applets Flash. What is a dynamic Web Page?. General Definition:

gail-mullen
Download Presentation

Dynamic Web Pages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dynamic Web Pages Brad Polzar March 8, 2007

  2. Outline • What are Dynamic Web Pages? • Server Side Dynamics • Active Server Pages • Hypertext Preprocessor • Client Side Dynamics • JavaScript • Java Applets • Flash

  3. What is a dynamic Web Page? • General Definition: • A web page that changes based on the input of the user outside of navigating to another page. • A more specific definition: • A web page that dynamically decides what to display given the user’s actions and/or conditions that are currently met. • A really picky one: • A web page that is the result of a server dynamically deciding what html code to send based on user actions and currently met conditions.

  4. Server Side • Premise • Server Side Scripting • Active Server Pages • Hypertext Preprocessor

  5. Active Server Pages (ASP) • Microsoft’s version of dynamic web pages • Can use one of four scripting languages: • VBScript • JScript • PerlScript • Python • Server Requirements • Instant ASP (iASP) • Chili!ASP • Can also run on other platforms

  6. An ASP Page • Embedded into an html page • Tags • <% and %> • <%@ Language= %> • <script> and </script> <%@ Language=VBScript %> <html> <body> <% Response.Write(“Hello World!”) %> </body> </html>

  7. The Browser’s Code <%@ Language=VBScript %> <html> </body> <% Response.Write(“Hello World!”) %> </body> </html> <html> </body> Hello World! </body> </html>

  8. ASP Collections • Similar to a sorted array • Name / Value pairs • Name: Brad • Class: CS4110 • Date: Mar 8, 2007

  9. ASP Objects • Response Object • Request Object • Session Object • Application Object • Server Object • ObjectContext Object • ASPError Object

  10. Response Object • Deals with the response to the client • Methods • Write • Redirect • Flush • End • Clear • Handles writing cookies

  11. Request Object • Deals with the request to the server • Collections • Cookies • Query String • Form

  12. QueryString and Form • Both pass information from client to server • QueryString • Passes through URL • http://www.mywebsite.com/asp?querystring • …?field1=value&field2=value2&… • Request.QueryString(field1) • Form • Passes through request • Request.Form(field1)

  13. Getting QueryString and Form Info • Use html forms • To pass via QueryString • <form method=“get”> • To pass via Form • <form method=“post”>

  14. Cookies • Stored on client’s computer • Automatically sent with request • Pros: • Keeps info off of server • Fairly small • Cons: • Doesn’t maintain account across multiple computers • Not all computers allow • Expiration • Only simple data types

  15. Creating Cookies • Simple Cookie – one value • <% Response.Cookies(“varName”) = “value” %> • Will create if it doesn’t exist • Will overwrite if does • MUST DO THIS BEFORE THE <html> TAG! • Complex Cookie – A Cookie with Keys • Can set a cookie to have multiple values <% Response.Cookies(“cookieName”)(“field1”) = “value1” Response.Cookies(“cookieName”)(“field2”) = “value2” %>

  16. Reading Cookies • Will automatically send with request • <% var = Request.Cookies(“varName”) %> • Will return “” if varName is not a cookie

  17. Session Object • Holds information of client’s current session • Uses: Stores complex info • Objects • Arrays • Negatives: • Session ending time • Space on server • Server Performance • Used through cookies

  18. Application Object • Keeps state of the server • Only one instance • Used for data that is global and changed often

  19. Reading and Writing Files • Databases • Text Files

  20. ASP.Net • Same Objects as ASP • Uses .Net Common Runtime Languages • Visual Basic • Visual C# • Visual J#

  21. Hypertext Preprocessor (PHP) • Used to stand for Personal Home Page • Uses Apache Server • Is a scripting language • Is also a dynamic web technology • Current versions are PHP4 and PHP5

  22. A PHP Page • Tags • <?php and ?> • <script language=“php”> and </script> • <% and %>

  23. PHP syntax • Instruction separation - ; • Comments • Variables • Start with $ • Continue with name • Must start with _ or a letter • No type defined

  24. PHP variables • Eight types • Four primitive • Integer • Floating point • String • Boolean • Two compound • Object • Array • Two special • Resource • NULL

  25. PHP Variables Con’t • PHP4 – can assign by reference • Don’t have to initialize • Default values • Integer and Floating Point: 0 • String: empty string • Boolean: False • Array: empty array

  26. PHP SuperGlobals • SuperGlobal • Def: predefined variables global in every scope • $GLOBALS • $_SERVER • $_GET • $_POST • $_COOKIES • $_FILE • $_ENV • $_REQUEST • $_SESSION

  27. PHP Database Support • Formats supported • Access • SQL • MySQL • Oracle

  28. Client-Side Scripting • Premise • JavaScript • VBScript

  29. JavaScript • Not simple Java • Procedural Script • Object-Orientated Script • Objects created at run-time • Intrinsic Objects • Number • String • Boolean • Date

  30. Client-side Scripting • Accessing Scripts • Include in HTML document • Reference another file • Access to client’s computer

  31. Other Dynamic Utilities • Flash • Java Applets

  32. Works Consulted • Mitchell, Scott and Atkinson, James. (2000) Sams Teach Yourself Active Server Pages 3.0 in 21 Days. Indiapolis, IN: Sams. • Achour, Mehdi, et al. (2007) PHP Manual. http://www.php.net/manual/en/. • w3schools.com “ASP Tutorial.” Retrieved March 5, 2007 from http://www.w3schools.com/asp/default.asp. • Wikipedia.org (2007) “ASP.Net.” Retrieved March 5, 2007 from http://en.wikipedia.org/wiki/ASP.NET. • Flanagan, David. (1998) JavaScript: The Definitive Guide. Sebastopol, CA: O’Reilly.

More Related