Tuesday, 27 March 2012

Dreamweaver


How To Use Dreamweaver

Click on any image for larger version

software available in http://www.study11.com/
Before you begin, Turn on your Dreamweaver Program!
1
Before you create your webpages, begin by creating a folder that will contain your entire website. Go to the File menu and from the drop down menu select "New Folder.

2
For this this exercise, click on the "untitled folder" and let's name our folder (sometimes called a "Directory") "my_web_site"
It is important as a rule-of-process, to always name folders, webpages and images with lowercase text and no spaces in their naming.
Other text that is not usuable in naming pages, images and folders are: [ !,-,@,#,$,%,^,&,*,(,)?,/,<,+,= ]

3
Open your "my_web_site" folder and create a new folder and name that new folder "images". The purpose of creating subfolders (sometimes called "sub-directories") are to hold specific files in our website.

4
Once we create and import images for our web pages, we will save those image files here. The purpose of these subfolders is to ensure better organization of your files.

5
Other types of subfolders that you may eventually include will be folders for your music, animation, and printable document files called pdf's.
Again the main reason for these subfolders is so you may organize your contents.

6
Now we can create our "Site" within Dreamweaver. Go to and click the Menu tab labeled "Site". From that drop down menu, select "New Site"

7
You should see a dialogue box appear, make sure the "Advanced Tab" is highlighted. Your instructor may opt to take you through the "Basic" tab sittings at first.

8
First we give our site a name (usually best to name the site the same as our folder we created earlier, except in this case you may have spaces).

9
Next we select the destination of our local root folder. This is the folder we just created for our website. Dreamweaver will assist us in managing our site. Click on the folder icon to right of lable for Local Root Folder: and navigate over to where you saved your "my_web_site" folder, click on that folder and then say choose.

9a
In the future, you may create your website folders with this option within the site manager.

9b
As well as Images folder and other sub folders may be created through site management options.

10
When you have finished defining your site, this is what you should see in your site manager.

11
Now lets create a blank web page to begin our work. Within Dreamweaver, go to "File" and click. From the drop-down menu select "New"

12
You will see a dialouge box that asked what sort of work you are doing. In this case make sure Basic Page and HTML are high-lighted and then click on "Create"

13
Next we need to be in the practice of before we begin our work, we should always name and save our files. Since this page will serve for now as our "Home Page" we always name our home page the "index" page. This is because when someone goes to your website, as in your case, "my_web_site". Their Internet browers looks for the "index" page as the first page. So save this page with the name index.html.
Save this index file to your site folder "my_web_site"

14
You should see this in your site manager. If your "Site" manager window is not open, just as when you created your site as in Example #6, Go to the "Site" menu, and select "Open Site" and then select "My Web Site" from the list and you can see the Site Manager. From this list you may select any file. Select the index.html file if it is not already open on your desktop.

15
When we see our index page (homepage) we can now give our website a title.

16
Click within the "Title" box and give your website a greeting, such as "Welcome to my website", that would include your name or name of materials convered in the website.

17
It should look something like this in the Title Bar

18
We could begin entering information on the index page as it is now. Yet to better organize information on your page, let's insert a table with a specific size and begin there to format our web pages.
Go To the "Insert" Menu item and then on the drop-down menu, go to and click "Table"

19
You should see a dialogue box that contains information about the Table you wish to insert. As you can see we have several options. For this exercise, lets create a table with 1 (one) Row, 1 (one) column, "fixed" at 640 pixels option, 0 (zero) border, and 0 (zero) cell padding. Once you become better aquainted with web page layout, you will want to utilize these options at a later time.Choose "OK" when you have finished.

20
Once you have inserted a Table, you have several options from your "Properties" Window. If you do not see your "Properties" Window, go to and click on the Window drop-down menu and click "Properties. The table has to be high-lighted (as on the left) to utilize the Properties window. Now you may work with the available back ground and border colors.

21
To choose your table, use the arrow tool to high-light the table. To make changes in table colors, use the "Properties" Toolbox display from the Menu "Window" to adjust "Brdr Color" for Border Colors.

22
To adjust the Border sizes, select the table and change the number within the "Properties Menu. To have a table without borders, input "0" zero.

23
To choose your table, use the arrow tool to high-light the table. To make changes in table colors, use the "Properties" Toolbox display from the Menu "Window" to adjust background colors choose "Bg Color" and select from the color menu.

24
Before you place text or images in your table, click in your table with your curser and select the appropriate alignment from the Properties Window". Depending on how you plan to create your page, you may choose from "Left, Center, Right". Default settings may be to the left. In the case of this exercise, choose the "Left" setting.

25
You may now type in or paste text from another document (i.e. - Word, or html) into your table. High-lighting the text gives you the option to change the colors of the text within the "Properties Box"

26
For Bright backgrounds you need to choose a light colored text, or better yet, rethink your color schemes for your backgrounds.

27
When using colors for text and table, be sure that you used colors that are high in contrast versus colors that are similar.

28
This is a more appropriate way to set your table and font colors. It is best to use high contrast when displaying text in a web page. You may also try light-colored text on a dark back ground.

29
Now lets insert an image into your website. Click your curser into the table you created.Go to "Insert: Menu and in the drop-down, click on Image.
You may need to either scan an image or seek a copyright free images from the Internet. If you scan an image, or take one with a digital camera, the resolution of the image needs to be 72-100 dots per inch (dpi) to work on the Internet correctly.

30
Addtionally if you want to insert other media, this is the same procedure, just go to the "Media" drop-down item and choose the appropriate media, (i.e.) Flash animation.
To continue with Image Insert, you will have to navigate to where you have your image saved. Sometimes it is best to save the images you will use in the "images" folder within your site. Dreamweaver will ask you if you want to save it there, if you have not.
Select the image you have saved and say Choose.

31
Once the image is chosen, it will be placed it into your table, to the left, right, or center, depending on how you have set up the alignment (see example 24).
You need now to name your image. Click on your image, the "Properties Box" changes depending on what is sellected. In the right upper corner is a section for "ALT" In that box, name what the image is. This option is for those that use the Internet with disabilities and may be unable to see images. This option alloys them to hear what the image is. If it is not assigned a name, the person using ALT tags will only here, "Image". It is a good policy to learn to add Alt tags to your images and Hot Spots for Persons under the American Disabilities Act (ADA)

32
Once your image is added to your website, it should show up in your site manager as shown here.

33
If we would like to make a Hot Spot over an image so we can add a Link to another site. First high-light the image. Next from the lower left side of the Properties Box, select the appropriate type of Hotspot (Squares, Circles, Polygons) and draw a Hot Spot over your image.

34
Again you have to name your Hot Spot in the Alt Tags Box. In this case, "The Washington Monument" is the appropriate text. Next you need to add the link to the external website. In this case it is http://www.nps.gov/wamo/home.htm
Once you have done this, you can test your link by going to "File" to the drop-down menu to "Preview in Browser", and select the Browser. A temporary copy of your webpage will be displayed and you can test your links.
To create a link to another page in your site. First you must create a new html document, just as was done for the "index" page. This time you may name the new document as you wish, just remember:
It is important as a rule-of-process, to always name folders, webpages and images with lowercase text and no spaces in their naming.
Other text that is not usuable in naming pages, images and folders are: [ !,-,@,#,$,%,^,&,*,(,)?,/,<,+,= ]

Monday, 26 March 2012

DISPLAYING CRICKET PLAYERS PROFILE USING AJAX

11) DISPLAYING CRICKET PLAYERS PROFILE USING AJAX
AIM:
      To write a program using AJAX for displaying cricket players profile.
ALGORITHM:
1.      Create an XHTML document (AjaxDemo.html) with the following.
(a)    Insert some images of cricket players.
(b)   Call the function getContent() with respect to the onmouseover event. The function accepts an argument that is the URL of another page contains the information about the player.
(c)    Call the function clearContent() with respect to the onmouseout event.
2.      Within this XHTML document, insert AJAX based JavaScript code with the following.
(a)    Create the object for ActiveXObject (for older versions of browsers such as IE5 and IE6).
(b)   Create the object for XMLHttpRequest (for modern browsers such as IE7+, Firefox, Chrome, Safari, and Opera).
(c)    AJAX send the request with the use of send() and open() methods.
(d)   Receive the response with the use of responseText Property.
(e)    AJAX Call the function diplayProfile() with respect to the event onreadystatechange.

PROGRAM:
AjaxDemo.html
<html>
<head>
<title>Ajax Demo...</title>
<style type="text/css">
  .box{border:1px solid blue;padding:10px}
</style>
<script type="text/javascript">
var req;
function getContent(url)
{
 if(window.ActiveXObject)
 {
  req=new ActiveXObject("Microsoft.XMLHTTP");
 }
 else if(window.XMLHttpRequest)
 {
  req=new XMLHttpRequest();
 }
 req.onreadystatechange=diplayProfile;
 req.open('POST',url,true);
 req.send(null);
}
function diplayProfile()
{
 if(req.readyState==4)
 {
  document.getElementById('contentArea').innerHTML=req.responseText;
 }
}
function clearContent()
{
 document.getElementById('contentArea').innerHTML='';
}
</script>
</head>
<body bgcolor="cyan">
<h1>Mouse over the image for More Information</h1>
<img src="sachin.jpg" height="95" width="80" onmouseover='getContent("sachin.html")' onmouseout='clearContent()'/>
<img src="dravid.jpg" height="95" width="80" onmouseover='getContent("dravid.html")' onmouseout='clearContent()'/>
<img src="kohli.jpg" height="95" width="80" onmouseover='getContent("kohli.html")' onmouseout='clearContent()'/>
<img src="raina.jpg" height="95" width="80" onmouseover='getContent("raina.html")' onmouseout='clearContent()'/>
<img src="yuvi.jpg" height="95" width="80" onmouseover='getContent("yuvi.html")' onmouseout='clearContent()'/>
<img src="veeru.jpg" height="95" width="80" onmouseover='getContent("veeru.html")' onmouseout='clearContent()'/>
<img src="dhoni.jpg" height="95" width="80" onmouseover='getContent("dhoni.html")' onmouseout='clearContent()'/>
<div class="box" id="contentArea"/>
</body>
</html>
sachin.html
<html>
<body>
<b>Full name:</b> Sachin Ramesh Tendulkar<br/><br/>
<b>Born:</b> April 24, 1973, Bombay (now Mumbai), Maharashtra<br/><br/>
<b>Major teams:</b> India, Asia XI, Mumbai, Mumbai Indians, Yorkshire<br/><br/>
<b>Nickname:</b> Tendlya, Little Master<br/><br/>
<b>Playing role:</b> Top-order batsman<br/><br/>
<b>Batting style:</b> Right-hand bat<br/><br/>
<b>Bowling style:</b> Right-arm offbreak, Legbreak googly
</body></html>
dravid.html
<html>
<body>
<b>Full name:</b> Rahul Sharad Dravid<br/><br/>
<b>Born:</b> January 11, 1973, Indore, Madhya Pradesh <br/><br/>
<b>Major teams:</b> India, Scotland, Asia XI, ICC World XI, Karnataka, Kent,
Marylebone Cricket Club, Rajasthan Royals, Royal Challengers Bangalore<br/><br/>
<b>Nickname:</b> The Wall<br/><br/>
<b>Playing role:</b> Top-order batsman<br/><br/>
<b>Batting style:</b> Right-hand bat<br/><br/>
<b>Bowling style:</b> Right-arm offbreak
</body>
</html>
kohli.html
<html>
<body>
<b>Full name:</b> Virat Kohli<br/><br/>
<b>Born:</b>November 5, 1988, Delhi<br/><br/>
<b>Major teams:</b>India, Delhi, India Red, India Under-19s, Royal Challengers Bangalore<br/><br/>
<b>Playing role:</b>Middle-order batsman<br/><br/>
<b>Batting style:</b>Right-hand bat<br/><br/>
<b>Bowling style:</b>Right-arm medium
</body>
</html>
raina.html
<html>
<body>
<b>Full name:</b> Suresh Kumar Raina<br/><br/>
<b>Born:</b>November 27, 1986, Muradnagar, Ghaziabad, Uttar Pradesh<br/><br/>
<b>Major teams:</b>India, Chennai Super Kings, India Blue, India Under-19s, Indian Board President's XI, Rajasthan Cricket Association President's XI, Uttar Pradesh, Uttar Pradesh Under-16s<br/><br/>
<b>Playing role:</b>Middle-order batsman<br/><br/>
<b>Batting style:</b>Left-hand bat<br/><br/>
<b>Bowling style:</b> Right-arm offbreak
</body>
</html>
yuvi.html
<html>
<body>
<b>Full name:</b>Yuvraj Singh<br/><br/>
<b>Born:</b>December 12, 1981, Chandigarh<br/><br/>
<b>Major teams:</b>India, Asia XI, Kings XI Punjab, Pune Warriors, Punjab, Yorkshire<br/><br/>
<b>Playing role:</b>Middle-order batsman<br/><br/>
<b>Batting style:</b>Left-hand bat<br/><br/>
<b>Bowling style:</b>Slow left-arm orthodox
</body>
</html>
veeru.html
<html>
<body>
<b>Full name:</b>Virender Sehwag<br/><br/>
<b>Born:</b>October 20, 1978, Delhi<br/><br/>
<b>Major teams:</b>India, Asia XI, Delhi, Delhi Daredevils, ICC World XI, India Blue, Leicestershire, Rajasthan Cricket Association President's XI<br/><br/>
<b>Playing role:</b>Top-order batsman<br/><br/>
<b>Batting style:</b>Right-hand bat<br/><br/>
<b>Bowling style:</b>Right-arm offbreak
</body>
</html>
dhoni.html
<html>
<body bgcolor="cyan">
<b>Full name:</b> Mahendra Singh Dhoni<br/><br/>
<b>Born:</b>July 7, 1981, Ranchi, Bihar (now Jharkhand)<br/><br/>
<b>Major teams:</b>India, Asia XI, Bihar, Chennai Super Kings, Jharkhand<br/><br/>
<b>Playing role:</b>Wicketkeeper batsman<br/><br/>
<b>Batting style:</b>Right-hand bat<br/><br/>
<b>Bowling style:</b>Right-arm medium
</body>
</html>

IMAGE MAPPING

1) IMAGE MAPPING

india.html

<html>
<head>
<title>Image Mapping....</title>
</head>
<body>
<h1 align="center"><font face="Forte"color="violet">INDIA</font></h1>
<hr>
<p>
<font size="3" face="Comic Sans MS"color="darkblue">
<ul>
<li>The name India is derived from Indus, which is derived from the Old Persian word Hindu, from Sanskrit</li>
<li>India is the seventh-largest country by geographical area</li>
<li>The second-most populous country with over 1.2 billion people</li>
<li>The most populous democracy in the world</li>
<li>Consisting of 28 states and seven union territories</li>
<li>The name India is derived from Indus, which is derived from the Old Persian word Hindu, from Sanskrit</li>
</ul>
<p>
<font size="4" face="Calibri"color="red">
Click On The Hotspots To View More Information About That Particular Places...
</font>
</p>
<map name="indiamap">
<area shape="rect" coords="213,404,223,413" href="chennai.html" alt="Click here to get more details">
<area shape="rect" coords="168,168,182,178" href="delhi.html" alt="Click here to get more details">
<area shape="rect" coords="113,313,126,323" href="mumbai.html" alt="Click here to get more details">
<area shape="rect" coords="358,251,370,261" href="kolkatta.html" alt="Click here to get more details">
</map>
<img src="india.jpg" border=0 usemap="#indiamap">
</body>
</html>

chennai.html

<html>
<Title>Chennai....</title>
<body>
<p><font face="Cambria" color="blue" size="3">Chennai, formerly known as Madras or Madarasapatinam,
is the capital city of the Indian state of Tamil Nadu...</font></p>
<table>
<tr>
<td><img src="Parrys.jpg"><br>
<font face="Cambria" color="blue" size="3">Parry's Corner</td>
<td>
<font face="Cambria" color="blue" size="2">
<ul>
<li>Chennai being the fourth most populous metropolitan area and the fifth most populous city in India</li>
<li>It is also the world's 36th largest metropolitan area</li>
<li>Chennai's economy has a broad industrial base in the automobile, computer, technology, hardware manufacturing, and healthcare industries</li>
<li>The city is India's second largest exporter of software, information technology (IT) and information-technology-enabled services (ITES)</li>
<li>Chennai is a major centre for music, art and culture in India</li>
<li>The city is known for its classical dance shows and Hindu temples</li>
<li>Cricket is the most popular sport in Chennai</li>
<li>Chennai is the base for the large Tamil movie industry, known as Kollywood, home to most of the movie studios</li>
</ul>
</td>
</tr>
</table>
<font face="Cambria" color="blue" size="2">
<a href="india.html">Home</a>
</font>
</body>
</html>

delhi.html

<html>
<Title>Delhi....</title>
<body>
<p><font face="Cambria" color="blue" size="3">Delhi is the eighth largest
metropolis in the world by population with more than 12.25 million people...</font></p>
<table>
<tr>
<td><img src="LotusTemple.jpg"><br>
<font face="Cambria" color="blue" size="3">Lotus Temple</td>
<td>
<font face="Cambria" color="blue" size="2">
<ul>
<li>Which also includes Noida, Greater Noida, Ghaziabad, Gurgaon and Faridabad along with other smaller nearby towns</li>
<li>Delhi has a maximum length of 51.9 km (32 mi) and the maximum width of 48.48 km (30 mi)</li>
<li>The annual mean temperature is 25 °C (77 °F)</li>
<li>The average annual rainfall is approximately 714 mm (28.1 inches)</li>
</ul>
</td>
</tr>
</table>
<font face="Cambria" color="blue" size="2">
<a href="india.html">Home</a>
</font>
</body>
</html>

mumbai.html

<html>
<Title>Mumbai....</title>
<body>
<p><font face="Cambria" color="blue" size="3">It is the most populous city in India, and the second most populous city in the world,
with a population of approximately 14 million...</font></p>
<table>
<tr>
<td><img src="Gateway.jpg"><br>
<font face="Cambria" color="blue" size="3">Gateway Of India</td>
<td>
<font face="Cambria" color="blue" size="2">
<ul>
<li>Mumbai, formerly known as Bombay </li>
<li>Mumbai is the capital of the Indian state of Maharashtra</li>
<li>Mumbai is the commercial and entertainment capital of India</li>
<li>The average annual temperature is 27.2 °C (81.0 °F)</li>
</ul>
</td>
</tr>
</table>
<font face="Cambria" color="blue" size="2">
<a href="india.html">Home</a>
</font>
</body>
</html>

kolkatta.html

<html>
<Title>Kolkata....</title>
<body>
<p><font face="Cambria" color="blue" size="3">Kolkata is the cultural capital of India
and the commercial capital of Eastern India...</font></p>
<table>
<tr>
<td><img src="VictoriaMemorial.jpg"><br>
<font face="Cambria" color="blue" size="3">Victoria Memorial</td>
<td>
<font face="Cambria" color="blue" size="2">
<ul>
<li>Kolkata, formerly known as Calcutta, is the capital of the Indian state of West Bengal</li>
<li>Before 1690 Kolkata, under direct rule of the Nawab of Bengal Siraj-Ud-Daulah</li>
<li>Kolkata is located in the eastern part India</li>
<li>The annual mean temperature is 26.8 °C (80.2 °F)</li>
</ul>
</td>
</tr>
</table>
<font face="Cambria" color="blue" size="2">
<a href="india.html">Home</a>
</font>
</body>
</html>

india.jpg

Gateway.jpg
VictoriaMemorial,jpg














LotusTemple.jpg
Parrys.jpg

online examination using jsp

) ONLINE EXAMINATION USING JSP

AIM:
      To create a  three tier application for conducting online examination using JSP and database.

ALGORITHM:
1.       Design the HTML page (ExamClient.html) with the following
a)      Create a form to get the input from the user.
b)      Use radio buttons to make various options for the questions.
c)       Set the URL of the server (ExamServer.jsp) as the value of the action attribute.
d)       Use submit button to invoke the server and send the form data to the server.
2.       Create the JSP file with the following
a)       Read the input from the client.
b)       Retrieve the answers from the database.
c)       Match the answers from the user with the correct answers from the database table.
d)       For each correct answer increment the mark by 5.
e)       Server displays the mark and result to the client as a response.

PROGRAM:

ExamClient.html

<html>
<head>
<title>Online Exam Client</title>
<style type="text/css">
   body{background-color:black;font-family:courier;color:blue}
</style>
</head>
<body>
<h2 style="text-align:center">ONLINE EXAMINATION</h2>
<h3>Answer the following questions (5 marks for each correct answer)</h3>
<hr/>
<form name="examForm" method="post" action="ExamServer.jsp">
1.Who is called as the father of computer?<br/>
<input type="radio" name="ans1" value="Sachin">Sachin
<input type="radio" name="ans1" value="Stuart">Stuart
<input type="radio" name="ans1" value="Charles Babbage">Charles Babbage
<input type="radio" name="ans1" value="Napier">Napier
<br/><br/>
2.C++ was developed by?<br/>
<input type="radio" name="ans2" value="Dennis Ritchie">Dennis Ritchie
<input type="radio" name="ans2" value="None">None
<input type="radio" name="ans2" value="David Ritchie">David Ritchie
<input type="radio" name="ans2" value="John">John
<br/><br/>
3.C was developed by?<br/>
<input type="radio" name="ans3" value="Dennis Ritchie">Dennis Ritchie
<input type="radio" name="ans3" value="Stroustrup">Stroustrup
<input type="radio" name="ans3" value="David Ritchie">David Ritchie
<input type="radio" name="ans3" value="Charles Babbage">Charles Babbage
<br/><br/>
<input type="submit" value="Check Your Result"/>
</form>
</body>
</html>

ExamServer.jsp

<%@page contentType="text/html" language="java" import="java.sql.*"%>
<html>
<head>
<title>Online Exam Server</title>
<style type="text/css">
   body{background-color:black;font-family:courier;color:blue}
</style>
</head>
<body>
<h2 style="text-align:center">ONLINE EXAMINATION</h2>
<p>
<a href="ExamClient.html">Back To Main Page</a>
</p>
<hr/>
<%
String str1=request.getParameter("ans1");
String str2=request.getParameter("ans2");
String str3=request.getParameter("ans3");
int mark=0;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:examDS");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("SELECT * FROM examTab");
int i=1;
while(rs.next())
{
 if(i==1)
 {
  String dbans1=rs.getString(1);
  if(str1.equals(dbans1))
  {
   mark=mark+5;
  }
 }
 if(i==2)
 {
  String dbans2=rs.getString(1);
  if(str2.equals(dbans2))
  {
   mark=mark+5;
  }
 }
 if(i==3)
 {
  String dbans3=rs.getString(1);
  if(str3.equals(dbans3))
  {
   mark=mark+5;
  }
 }
 i++;
}
if(mark>=10)
{
 out.println("<h4>Your Mark Is : "+mark+"</h4>");
 out.println("<h3>Congratulations....! You Are Eligible For The Next Round...</h3>");
}
else
{
 out.println("<h4>Your Mark is : "+mark+"</h4>");
 out.println("<h3>Sorry....!! You Are Not Eligible For  The Next Round...</h3>");
%>
</form>
</body>
</html>
 
Database Name: examDB.accdb
Table Name: examTab