Professional Documents
Culture Documents
CLASS: MCA
SECTION: D3804
Declaration:
I declare that this assignment is my individual work, I have not copied from any other
student’s work or from any other source except where due acknowledgement is made
explicitly in text, not has any part become written for me by another person.
Paramjit Kaur
Part A
Q1. What is the significance of a form & the attributes used in form tag?
Design a feedback form for Mc Donald customers.
Answer: SIGNIFICANCE: Forms are a vital tool for the webmaster to receive
information from the web surfer, such as: their name, email address, credit card, etc. A
form will take input from the viewer and depending on your needs; you may store that
data into a file, place an order, gather user statistics, register the person to your web
forum, or maybe subscribe them to your weekly newsletter
Attributes
ACTION
The ACTION attribute is a URL specifying the location to which the contents of
the form are submitted to elicit a response. If the ACTION is missing, the URL
for the document itself is assumed. The way data is submitted varies with the
access protocol of the URL, and with the values of the METHOD and ENCTYPE
attributes.
METHOD
This specifies variations in the protocol used to send the form contents. It is
currently restricted to GET (the default) or POST. The attribute was introduced
to inform user agents which HTTP methods the server supports.
ENCTYPE
This attribute specifies the MIME content type to be used to encode the form
contents. It defaults to the string: "application/x-www-form-urlencoded"
SCRIPT
This can be used to give a URI for a script. The scripting language and the
interface with the user agent is not part of the HTML 3.0 specification.
<html>
<body>
<form>
Customers</center></font><br><br>
name="Customer"><br>
Mobile Number: <input
type="Text" name="Contact"></input><br><br>
Select a Country:
<option>America</option>
<option>Australia</option>
<option>Canada</option>
<option>England</option>
<option>India</option>
<option>Russia</option>
</select><br><br>
</form>
</table></html>
Q2. What are various controls used in forms, enumerate with the help of
example.
Answers: 1) The Tools toolbar and Tools (Advanced) toolbars are used with Forms to
create Windows standard user interface controls. These toolbars are enabled when a
Form is the active window. Forms are used to provide user interfaces to scripts, to view
tables and for other functions within Manifold.
Frequently Used Controls
a) Submit button
b) Radio button
c) Button
e) Pop ups
The code above will create the submit button as shown below:
Click!
b) Radio button
What size pizza? <P>
Small
medium
large
submit
c) Button
<BUTTON ...> creates a button. Unlike <INPUT ...>, <BUTTON ...> is a container
which allows you to put regular HTML contents in the button, including text and
pictures. Unfortunately, <BUTTON ...> does not degrade well, and so at this time
it's best to stick with <INPUT ...>.
multiple: If set to "multiple" then allows a user to select multiple items from the
menu.
value: The value that is sent to the server if this option is selected.
selected: Specifies that this option should be the initially selected value when the
page loads.
e) Pop ups:
The technique described here addresses all the major issues in
popups. The popup always comes to the front. Different links can target the same
popup.
Creating a popup
function popitup(url) {
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
</script>
Part B
Q4. How inline frames are useful. Explain with example.
Answer: An inline frame ("floating frame") is a construct which embeds a document
into an HTML document so that embedded data is displayed inside a sub window of the
browser's window. This does not mean full inclusion; the two documents are
independent, and both them are treated as complete documents, instead of treating one
as part of the other
I frame display the document referred to by the URL in a sub window, typically with
vertical and/or horizontal scroll bars; such browsers ignore the content of the I frame
element (i.e. everything between the start tag <iframe...> and the end tag </I frame>).
Browsers which do not support iframe (or have such support disabled) do the opposite:
process the content as if the <iframe...> and </iframe> tags were not there. Thus, the
content matters, despite being ignored by some browsers. See below for notes on
designing that content.
As a simple example, consider the following situation. We have a site which contains a
separately updated newsflashes page, say news.html. We would like to embed that page
into some other page(s) so that the first few lines of its content are directly visible and
the rest of it can be viewed by vertical scrolling. This could be written in HTML as
follows:
<iframe src="news.html"
width="40%" height="80"
align="right">
Browser support
Browser to the iframe element is not very wide yet, but increasing:
Internet Explorer has supported iframe since version 3. However, IE as well other
browsers have problems in the support, as discussed later in this document.
Netscape 6 supports iframe. It has been reported that Netscape 4.7 on Mac has iframe
support, but all Netscape 4.x versions on Windows probably lack support. And it has
been reported that Mozilla M12 supports iframe.
WebTV Plus has iframe support, but the "small bugs" include failure to comply with
the fundamental idea of using the content of the element only if the inline frame itself is
not displayed.
Lynx 2.8.2 handles iframe in a manner similar to its treatment of normal frames: it
provides a link (preceded by the text IFRAME:) to the document specified in the src
attribute of the iframe tag and then renders the content of the iframe element. As the
link text, it uses the name attribute if present, otherwise the URL (the src attribute
value).
Opera 4.0 beta supports iframe, with the option to turn the support off (as
independently of normal frame support), and the default setting seems to be to have the
support disabled.
Q5. Using suitable example, enumerate the purpose of Global and ass files
in ASP.
ANSWER:- Ans: The Global.asa file is an optional file that can contain declarations of
objects, variables, and methods that can be accessed by every page in an ASP
application. All valid browser scripts (JavaScript, VBScript, JScript, PerlScript, etc.)
can be used within Global.asa. The Global.asa file can contain only the following:
• Application events
• Session events
• <object> declarations
• TypeLibrary declarations
For example we will create a Global.asa file that counts the number of current visitors.
• The Application_OnStart sets the Application variable "visitors" to 0 when the server
starts
• The Session_OnStart subroutine adds one to the variable "visitors" every time a new
visitor arrives
• The Session_OnEnd subroutine subtracts one from "visitors" each time this
subroutine is triggered
Q6. Write the steps for database connectivity for a web page? Give
example.
ANSWER:- Establishing a JDBC database connection in two steps
Once you have the correct JDBC driver installed, establishing a JDBC connection from
your Java programs to your SQL database is pretty easy.
Listing 1 provides the full source code required to establish a JDBC connection to a
mSQL database on a server named "www.myserver.com".
/ Establish a connection to a mSQL database using JDBC.
import java.sql.*;
class JdbcTest1 {
try
Class.forName("com.imaginary.sql.msql.MsqlDriver");
catch (Exception e)
System.err.println(e.getMessage());