WEEK - 1:: Web Technologies Lab Manual
WEEK - 1:: Web Technologies Lab Manual
WEEK 1:
Aim: Design the following static web pages required for online book store. 1. Home page:- the static home page must contains three pages 2. Top frame:- logo and college name and links to homepage, login page, registration Page, catalogue page and cart page 3. Left frame:- at least four links for navigation which will display the catalogue of Respective links 4. Right frame:- the pages to links in the left frame must be loaded here initially it Contains the description of the website SOURCE CODE:bookstore.html <frameset rows="18%,*"> <frame src="topframe.html" scrolling="no"/> <frameset cols="15%,*"> <frame src="leftframe.html" noresize/> <frame src="rightframe.html" name="rframe"/> </frameset> </frameset> topframe.html <html> <head> <title> Top Frame </title> </head> <body bgcolor=#bbffbb> <table border="1" width="100%"> <tr> <th width="14%"> <img src="book.gif" width=100 height=50/></th> <th> AMAZON.COM </th> </tr> </table> <table border="1" width="100%"> <tr> <th><a href="rightframe.html" target="rframe">Home</a></th> <th><a href="login.html" target="rframe">Login</a></th> <th><a href="register.html" target="rframe">Register</a></th> <th><a href="catalogue.html" target="rframe">Catalogue</a></th> <th><a href="cart.html" target="rframe">Cart</a></th> jkdirectory jkmaterialz jkd
jkdirectory
jkmaterialz
jkd
LOGIN PAGE
CATALOGUE PAGE
jkdirectory
jkmaterialz
jkd
WEEK 2:
Aim: Design the following static web pages required for online book store. 1. Home page: - the static home page must contains three pages 2. Top frame: - logo and college name and links to homepage, login page, registration Page, catalogue page and cart page 3. Left frame: - at least four links for navigation which will display the catalogue of Respective links 4. Right frame: - the pages to links in the left frame must be loaded here initially it Contains the description of the website 5. Registration page and 6. Cart page SOURCE CODE:bookstore.html
<frameset rows="18%,*"> <frame src="topframe.html" scrolling="no"/> <frameset cols="15%,*"> <frame src="leftframe.html" noresize/> <frame src="rightframe.html" name="rframe"/> </frameset> </frameset> topframe.html <html> <head> <title> Top Frame </title> jkdirectory jkmaterialz jkd
CART PAGE
jkdirectory
jkmaterialz
jkd
REGISTRATION PAGE
WEEK 3:
jkdirectory jkmaterialz jkd
SOURCE CODE:validate.html
<html> <head> <h1 align=center>Welcome to Validation Checking</h1><hr width=50%> <script language="javascript"> function validation() { var x=f.un.value; var len=x.length; var val=x.charCodeAt(0); var p=f.pw.value; var c=f.cpw.value; var a=f.email.value; var atpos=a.indexOf("@"); var dotpos=a.lastIndexOf("."); if(len<6 || x=='' || x==null) { alert("check your username! must be minimum 6 characters"); if(val<65 || val>90 && val <97 || val>122) alert("username must begin with an alphabet"); return false; } else if(val<65 || val>90 && val <97 || val>122) { alert("username must begin with an alphabet"); return false; } else if(p=='' || c=='' || p.length<6 || c.length<6 || p!=c) { alert("Password and Confirm Password should be same and greater than 6 characters!"); return false; } else if(atpos<6 || dotpos<atpos+6 || dotpos+2>=a.length) { alert("Not a valid email id"); return false; } else alert("Congragulations! you have submited successfully"); } </script> jkdirectory jkmaterialz jkd
Result:-
After the details entered and by clicking submit button it show the dialog box as follows:
jkdirectory
jkmaterialz
jkd
After clicking OK button it is redirected to validate.html If the username, password, confirm password, and e-mail are entered correctly then it shows the dialog box as follows:
jkdirectory
jkmaterialz
jkd
jkdirectory
jkmaterialz
jkd
jkdirectory
jkmaterialz
jkd
WEEK 5:
Aim: Write an XML file which displays the book details that includes the following: 1) Title of book 2) Author name 3) Edition 4) Price Write a DTD to validate the above XML file and display the details in a table (to do this use XSL). SOURCE CODE:book.dtd <!ELEMENT bookdetails (books+)> <!ELEMENT books (title,author,edition,price)> <!ELEMENT title (#PCDATA)> <!ELEMENT author (#PCDATA)> <!ELEMENT edition (#PCDATA)> <!ELEMENT price (#PCDATA)> book.xml <?xml version="1.0"?> <!DOCTYPE bookdetails SYSTEM "book.dtd"> <?xml:stylesheet type="text/xsl" href="book.xsl"?> <bookdetails> <books> <title> C </title> <author> Balaguruswamy </author> <edition> Edition-II </edition> <price>$30.00</price> </books> <books> <title> C++ </title> <author> yaswanth kanethkar </author> <edition> Edition-I </edition> <price>$35.00</price> </books> <books> <title> JAVA </title> <author> Herbert Schildt </author> <edition> Edition-IV </edition>
jkdirectory jkmaterialz jkd
jkdirectory
jkmaterialz
jkd
WEEK 6
Aim: Create a simple visual bean with a area filled with a color. The shape of the area depends on the property shape. If it is set to true then the shape of the area is Square and it is Circle, if it is false. The color of the area should be changed dynamically for every mouse click. The color should also be changed if we change the color in the property window . SOURCE CODE:colors.java package sunw.demo.colors; import java.awt.*; import java.awt.event.*; public class colors extends Canvas { transient private Color color; private boolean rectangular; public colors() { addMouseListener(new MouseAdapter(){ public void mousePressed(MouseEventme) { change(); }}); rectangular=false; setSize(200,100); change(); } public boolean getRectangular() { return rectangular; } public void setRectangular(boolean flag)
jkdirectory jkmaterialz jkd
jkdirectory
jkmaterialz
jkd
WEEK 7
Aim: Install IIS web server and APACHE. 1) While installation assign port number 4040 to IIS and 8080 to APACHE. Make sure that these ports are available i.e., no other process is using this port.
2) Access the above developed static web pages for books web site, using these servers by putting the web pages developed in week-1 and week-2 in the document root. Access the pages by using the URLs : http://localhost:4040/rama/books.html (for tomcat) http://localhost:8080/books.html (for Apache)
SOURCE CODE:Installation Steps for IIS: Step-1 : Open Control Panel and choose add or remove programs
jkdirectory
jkmaterialz
jkd
Step-3: Now check the check box named with Internet Information Services and click on next button
jkdirectory
jkmaterialz
jkd
Step-4: Now select performance and maintenance under the control panel.
jkdirectory
jkmaterialz
jkd
jkdirectory
jkmaterialz
jkd
Step-6: Now Select Internet Information Services option in the window given below:
Step-7: Now right click on the default web site (stopped) and choose the properties
jkdirectory
jkmaterialz
jkd
jkdirectory
jkmaterialz
jkd
Step-3: Now select the type of installation upon your desire and click on next.
jkdirectory
jkmaterialz
jkd
Step-5: Now assign the port value of HTTP/1.1 connector port to 8080.
jkdirectory
jkmaterialz
jkd
jkdirectory
jkmaterialz
jkd
WEEK 8
Aim: User Authentication
Assume four users user1, user2, user3 and user4 having the passwords pwd1, pwd2, pwd3 and pwd4 respectively. Write a PHP for doing the following. 1. Create a Cookie and add these four user IDs and passwords to this Cookie. 2. Read the user id and passwords entered in the Login form (week1) and authenticate with the values (user id and passwords) available in the cookies. If he is a valid user (i.e., user-name and password match) you should welcome him by name (user-name) else you should display You are not an authenticated user .
SOURCE CODE:coklogcheck.html <html> <title>website</title> <head></head> <body> <form method="POST" name="frmlogin" action="coklogcheck.php"> <table border="0"> <tr>
jkdirectory jkmaterialz jkd
WEEK 9
Aim: Install a database (Mysql or Oracle). Create a table which should contain at least the following fields: name, password, email-id, phone number (these should hold the data from the registration form). Write a PHP program to connect to that database and extract data from the tables and display them. Experiment with various SQL queries. Insert the details of the users who register with the web site, whenever a new user clicks the submit button in the registration page. SOURCE CODE:<?php $con= mysql_connect("localhost", "root", "") or die('could not connect to server'); mysql_select_db("pavan", $con) or die('could not connect to database'); $user = $_POST['Uname']; $pssword = $_POST['password']; //$query = "SELECT userid from users where userid = '$userid' PASSWORD('$password')"; $query = "SELECT * from users"; $result = mysql_query($query);
jkdirectory jkmaterialz
and
password
jkd
jkdirectory
jkmaterialz
jkd
WEEK 10
Aim: Write a PHP which does the following job: Insert the details of the 3 or 4 users who register with the web site (week9) by using registration form. Authenticate the user when he submits the login form using the user name and password from the database (similar to week8 instead of cookies). SOURCE CODE:<?php
jkdirectory jkmaterialz jkd
WEEK 11
Aim: Create tables in the database which contain the details of items (books in our case like Book name, Price, Quantity, Amount) of each category. Modify your catalogue page (week 2) in such a way that you should connect to the database and extract data from the tables and display them in the catalogue page using PHP
SOURCE CODE:cart.php
jkdirectory jkmaterialz jkd
WEEK 12
Aim: The user may add some items to cart from the catalogue page. He can check the cart page for the selected items. He may visit the catalogue again and select some more items. Here our interest is the selected items should be added to the old cart rather than a new cart. Multiple users can do the same
jkdirectory jkmaterialz jkd
login.php <?php
jkdirectory jkmaterialz jkd
jkdirectory
jkmaterialz
jkd