FREE ASSIGNMENT OF PHP for AIMA STUDENT
SECTION A
1. (a) Explain the role of Web browser and Web server while using the web application at user end .
How Web Browsers Work
The World Wide Web is a system of Internet servers that support specially formatted documents. AWeb browsers are used to make it easy to access the World Wide Web. Browsers are able to display Web pages largely in part to an underlying Web protocol called HyperText Transfer Protocol (HTTP). HTTP defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. It is what allows Web clients and Web servers to communicate with each other. When you enter a Web address (URL) in your browser, this actually sends an HTTP command to the Web server directing it to fetch and transmit the requested Web page and display the information in your browser. All Web servers serving Web sites and pages support the HTTP protocol.
Example: The URL to reach the definition of browser is: http://www.praveengagan.com/about.html
Once you enter the URL "http://www.praveengagan.com/about.html" into your address line, the browser breaks that Web address down into three distinct parts.
The Protocol: "http"
The server name: "www.praveengagan.com"
The file name, which follows the server name: "about.html"
In order for your browser to actually connect to the Web server to retrieve the information you request, it communicates with a name server to translate the server name into an IP address. Your Web browser is then able to connect to the Web server at the resolved IP address on port 80. Once your browser has connected to the Web server using HTTP, the browser then reads the HyperText Markup Language (HTML), the authoring language used to create documents on the World Wide Web, and the data is then displayed in your Web browser.
Most Popular Web Browsers
A Web browser is actually a software application which runs on your Internet-connected computer. It allows you to view Web pages, as well as utilize other content and technologies such as video, graphics files, and digital certificates, to name a few. Some browsers will translate only text while others do support graphics and animation. Web browsers are not all created equal, and Web pages also will not be displayed the same in different browsers.
WEB SERVER
Web servers are computers on the internet that host websites, serving pages to viewers upon request. This service is referred to as web hosting.
Every web server has a unique address so that other computers connected to the internet know where to find it on the vast network. The IP (Internet Protocol) address looks something like this: 192.168.1.1.
Web hosts rent out space on their web servers to people or businesses to set up their own websites. The web server allocates a unique website address to each website it hosts.
When you connect to the internet, your personal computer also receives a unique IP address assigned by your ISP (internet service provider). This address identifies your computer's location on the network. When you click on a link to visit a website, like www.praveengagan.com, your browser sends out a request to the IP address. This request includes return information and functions like a postal letter sent across town, but in this case the information is transferred across a network.
When your request reaches its destination, the web server that hosts website sends the page in HTML code to your IP address. This return communiqué travels back through the network. Your computer receives the code and your browser interprets the HTML code then displays the page for you in graphic form.
The more powerful the server, the faster it can serve up website pages. Slower, smaller servers may result in frustrating lag time for viewers. High traffic can also slow servers that are not powerful enough to handle high volumes of data exchange. This lag time should be a concern if you are shopping for a web host. Most web hosts have a page dedicated to sharing technical information about their web server, including speed, capacity, network configuration and other details.
In theory, web servers stay connected to the Internet 24/7, 365 days a year. In truth they experience occasional downtime due to maintenance and technical problems. Web servers with consistent records of an uptime of 99.5% or better are considered reliable.
(b) In context of designing Web-application how you do session management for user application.
Answer 1 (b)
Session management for user application.
The stateless nature of HTTP requires organisations and solution developers to find other methods of uniquely tracking a visitor through a web-base application. Various methods of managing a visitor’s session have been proposed and used, but the most popular method is through the use of unique session IDs. Unfortunately, in too many cases organisations have incorrectly applied session ID management techniques that have left their “secure” application open to abuse and possible hijacking. This document reviews the common assumptions and flaws organisations have made and proposes methods to make their session management more secure and robust.
Session management
- Applications maintain state
- Distributed applications may maintain state in each distributed component
- Web applications are expected to maintain state
- Typical Web application: shopping cart, where the server is expected to keep a list of items in the cart, and present this list on demand
- Web support for state is poor
Stateful server
In a client-server application, the server may keep state information.
Stateless server
In a client-server application, the server may be stateless, with the client keeping state
Taking the Example of Web Application [As According to the Question]
Web Applications
- State must be maintained across CGI applications
- Requires the browser to maintain state information
- The browser cannot keep all of the server state - typically it keeps and returns a key for the server
- The key should not contain sensitive information such as credit card numbers
2. (a) Define SQL with examples. Discussed different level of SQL attacks while extracting data from the from the database
ANSWER 2(a)
SQL is short for Structured Query Language and is a widely used database language, providing means of data manipulation (store, retrieve, update, delete) and database creation.
Almost all modern Relational Database Management Systems like MS SQL Server, Microsoft Access, MSDE, Oracle, DB2, Sybase, MySQL, Postgres and Informix use SQL as standard database language. Now a word of warning here, although all those RDBMS use SQL, they use different SQL dialects. For example MS SQL Server specific version of the SQL is called T-SQL, Oracle version of SQL is called PL/SQL, MS Access version of SQL is called JET SQL, etc.
SQL works with relational databases. A relational database stores data in tables (relations). A database is a collection of tables.
EXAMPLE—A table consists a list of records - each record in a table has the same structure, each has a fixed number of "fields" of a given type.
| CIATable | ||||
| name | region | area | population | gdp |
| India | Asia | 527970 | 14728474 | 23400000000 |
| Zaire | Africa | 2345410 | 44060636 | 18800000000 |
| Zambia | Africa | 752610 | 9445723 | 7900000000 |
| Zimbabwe | Africa | 390580 | 11139961 | 17400000000 |
In CIATABLE each record is a row representing a country. There are five fields some fields are of type string, some are of type integer.
Eg1 This simple query shows the population and GDP of India
SQL for this:
SELECT population, gdp FROM ciaTable WHERE name='India'
Result: 14728474 2340000000
SQL also has commands to create tables, to add records, to delete records and to change the value of fields of existing records; you can specify read and write permissions for other users; you can commit and roll back transactions; you can add and delete fields from existing tables, specify indexes and create view
(b) Define regular expressions. How regular expressions are used for searching utilities for web applications.
Answer 2 (b)
DEFINITION
A regular expression (sometimes abbreviated to "regex") is a way for a computer user or programmer to express how a computer program should look for a specified pattern in textand then what the program is to do when each pattern match is found. For example, a regular expression could tell a program to search for all text lines that contain the word "Windows 95" and then to print out each line in which a match is found or substitute another text sequence (for example, just "Windows") where any match occurs.
Search & Replace has extensive support for Regular Expressions for advanced search &/or replace, where the search string follows a rule and is not always exactly the same. Regular Expressions use "special character operators," which are symbols that control the search, and "an expression," which is a combination of characters and operators that specifies a pattern. Regular Expressions can be used in replacements, they can be case sensitive, and they can use Binary Characters or special operators such as Counters, Insert Path & File Name, & environment variables.
Example of REGEX [*] for search utilities for web application
| Operator | Description | ||||||||||||||||||||
| * |
| ||||||||||||||||||||
3. (a) Discuss in details the role of cookies and session management in Web application .
ANSWER 3 (a)
Cookies
- Cookie are passed at the HTTP layer
- HTTP format is Set-Cookie: cookie-value
- Cookies are sent from the server to browser and returned from browser to server
- Cookies have
- a lifetime
- a domain
- a flag to return on secure or non-secure channels
Passing cookies from server to browser
- Cookies will be passed on the wire in the HTTP header
- Cookies may be passed from an HTML document to the HTTP layer by
· ...
· HTTP-EQUIV="Set-Cookie: ..."
·
- Cookies may be passed in a Perl CGI object by e.g.
· $cookie = $query->cookie(-name=>'sessionID',
· -value=>'xyzzy',
· -expires=>'+1h',
· -path=>'/cgi-bin/database',
· -domain=>'.capricorn.org',
· -secure=>1);
Retrieving cookie from browser
- The cookie value can be retrieved by e.g. Perl code
· $cookie = $query->cookie(name=>'sessionID');
Problems with cookies
- Some users turn off cookies for privacy reasons
- Cookies expire after a while
(b) List out various advantages using XML for developing Web application over other Web applications Languages.
ANSWER 3 (b)
XML's set of tools allows developers to create web pages - and much more. XML allows developers to set standards defining the information that should appear in a document, and in what sequence. XML, in combination with other standards, makes it possible to define the content of a document separately from its formatting, making it easy to reuse that content in other applications or for other presentation environments. Most important, XML provides a basic syntax that can be used to share information between different kinds of computers, different applications, and different organizations without needing to pass through many layers of conversion.
Web developers are the initial target audience, but database developers, document managers, desktop publishers, programmers, scientists, and other academics are all getting involved. XML provides a simple format that is flexible enough to accommodate wildly diverse needs. Even developers performing tasks on different types of applications with different interfaces and different data structures can share XML formats and tools for parsing those formats into data structures that applications can use. XML offers its users many advantages, including:
- Simplicity
- Extensibility
- Interoperability
- Openness
- A core of experienced professionals
Advantages of XML
Uses of XML
XML has a variety of uses, including:
- Web publishing: XML allows you to create interactive pages, allows the customer to customize those pages, and makes creating e-commerce applications more intuitive. With XML, you store the data once and then render that content for different viewers or devices based on style sheet processing using an XSL/XSLT processor.
- Web searching and automating Web tasks: XML defines the type of information contained in a document, making it easier to return useful results when searching the Web:
- For example, using HTML to search for books authored by Tom Wolf is likely to return instances of the term 'wolf' outside of the context of author. Using XML restricts the search to the proper context (say, the information contained in the
tag) and returns only the desired type of information. Using XML, Web agents and robots (programs that automate Web searches or other tasks) will be more efficient and produce more useful results. - General applications: XML provides a standard method to access information, making it easier for applications and devices of all kinds to use, store, transmit, and display data.
- e-business applications: XML implementations make electronic data interchange (EDI) more accessible for information interchange, business-to-business transactions, and business-to-consumer transactions.
- Metadata applications: XML makes is easier to express metadata (Unified Modeling Language design models or user interface properties, for example) in a portable, reusable format.
- Pervasive computing: XML provides portable and structured information types for display on pervasive (wireless) computing devices such as PDAs, cellular phones, and others.
- For example, WML (Wireless Markup Language) and VoiceXML are currently evolving standards for describing visual and speech-driven wireless device interface
This page comes with cookies: Enjoy!
count = .
start = .
This session has lasted




0 comments:
Post a Comment
Post a Comment