Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 28

Webtech practical file

Submitted in partial fulfillment of the requirements


for the degree of BCA

Submitted
By
LAKSHIT
41221091

RITU BANSAL
(Assistant
Professor
)
Designation
Department of BCA

DSEU

Department of BCA
Ambedkar Institute of Technology
Shakarpur Campus-1
DSEU
New Delhi, India2023

LAKSHIT 41221091
LAKSHIT 41221091 Page 1

LAKSHIT 41221091
Create a webpage represents frames divided in horizontal direction
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<frameset rows="33%,33%,33%">
<frame src="new.html"></frame>
<frame src="question5(3).html"></frame>
<frame src="question5(3).html"></frame>
</frameset>
</html>

OUTPUT

Create a hyperlink which opens in a window.

<html>
<head>
<title>Hello World</title>
<body>
<a href="question5(3).html" target="_blank"><h1>open in new window</h1></a>
</body>
</html>
OUTPU
LAKSHIT 41221091
T
Page 2

LAKSHIT 41221091
Create a Student registration form for taking admission in a university.

LAKSHIT 41221091
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<style>
td {
background-color: aqua;
}
</style>
<body bgcolor="yellow">
<table border ="1" width="100%">
<tr>
<td align="center"><h1>Student registration form for 2023</h1></td>

</tr>
</table>
<form target="frame1">
<p>Enter your name: <input type="text"></p>
<p>Gender <input type="radio"></p>
<p>Enter Fathers name <input type="text"></p>
<p>Enter mothers name <input type="text"></p>
<p>Enter Student phone no. <input type="text"></p>
<label for="DOB">DOB</label><input type="date" id="DOB" name="DOB">
<p>Enter permanent address <input type="text"></p>
<label for="upload">upload</label>
<input type="file" id="upload"><br><br>
<input type="submit" value="submit">

ABHISHEK 41221005 Page 3

LAKSHIT 41221091
</form>
</iframe>
</body>
</html>
OUTPUT

Create a hyperlink with a webpage to move towards top & bottom of the
webpage.

LAKSHIT 41221091
<html>
<head>
<title>
course
</title>
</head>
<body>
<marquee bgcolor="yellow">GAREEB SITE</marquee>
<a href="#bottom">go to bottom</a>
<div id="top"></div>

<div align="center" ><h3>Delhi Skill Enterpenurship University</h3></div>


<div>courses</div>
<ol>
<li>BBA</li>
<p>Bachelor of Business Administration or BBA is one of the<br> most popular
bachelor's degrees. This degree course is<br> about themanagement of a business, company
or organisation.<br> You are taught skills and in-depth knowledge of the business<br>
world, and all the intricate aspects of running a business.</p>
<b>Subjects</b>
<ul style="list-style-type:disc;">
<li>ITB</li>
Page 4

LAKSHIT 41221091
<li>Computer Application</li>
<li>Financial Accounting</li>
<li>E-commerce</li>
</ul><br>
<li>BCA</li>
<p>Bachelor of Computer Application or BCA is one of the<br> most popular
bachelor's degrees. This degree course is<br> about the knowledge of a coding, softwares
or networks.<br> You are taught skills and in-depth knowledge of the computers<br> world,
and all the intricate aspects of software skills</p>
<b>Subjects</b>
<ul style="list-style-type:disc;">
<li>C++</li>
<li>Computer Application</li>
<li>Java</li>
<li>Computer Networks</li>
</ul>
</ol><div id="bottom"></div>
<a href="#top">Go to top</a>

</body>
</html>

OUTPUT

LAKSHIT 41221091
Page 5

LAKSHIT 41221091
Write PHP code to find largest of two numbers.
<?php
$num1=2;
$num2=15;
if($num1>$num2){
echo "NUM1 is grater which is : $num1 ";
}
else{
echo " num 2 is greater which is : $num2";
}

?>
OUTPUT

Write javascript code to accept three numbers from user using pop
up message box & find the average.

LAKSHIT 41221091
<!DOCTYPE html>
Page 6

LAKSHIT 41221091
<html lang="en">
<head>

<title>Document</title>
</head>
<body>
<script>
var a = parseInt(prompt("Enter First Number: "));
var b = parseInt(prompt("Enter Second Number: "));
var c = parseInt(prompt("Enter Third Number: "));

//Calculate Average
var average = (a + b + c) / 3;

//Display Output
document.write("The average of three numbers: " + average);
</script>

</body>
</html>

OUTPUT

Create a webpage to display Diwali e-greeting card.

<html>
<head><title>Document</title>
</head>

<body>
<h1 style="color: rgba(209, 174, 20, 0.767);">HAPPY DIWALI</h1>
<h1 id="1" style="color: red;"></h1>
<script>

LAKSHIT 41221091
Page 7

LAKSHIT 41221091
var a= prompt("enter your name"); document.getElementById("1").innerHTML=a;
</script>
<h2>May the upcoming </h2>
<p>Diwali brings the<strong>Magic</strong><strong> of Happiness</strong>joy in your
life</p>
<p>Be haappy</p>
<p style="color: green;">–Your friend, Abhishek</p>
</body>
</html>

OUTPUT

Write javascript code to find percentage of marks of five subjects.

LAKSHIT 41221091
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
Page 8

LAKSHIT 41221091
<body>
<script>
var avg=0
var sum=0
var m1=80
var m2=90
var m3=97
var m4=98
var m5=84
sum=m1+m2+m3+m4+m5
document.write("total marks " ,sum)
avg=sum/5
document.write('<br>average of marks are : ',avg)
</script>
</body>
</html>
OUTPUT

Create a webpage which represents merging of cells in a table using


rowspan & colspan

LAKSHIT 41221091
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<table border="1">
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td
rowspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;</td>
</tr>
<tr>
<td></td>

</tr>

Page 9

LAKSHIT 41221091
</table>

</body>
</html>

OUTPUT

Create two divisions of a webpage. Insert hyperlink in first frame &


display the linked webpage in second frame.

<html>
<head>
<title>Hello World</title>
<body>
<a href="question5(3).html" ><h1>Click here to go see linked page</h1></a>
</body>
</html>

<html lang="en">
<head><title>question 1</title>
</head>
<frameset cols="50%,50%">
<frame src="new.html"></frame>
<frame src="question5(3).html"></frame>
</frameset>
</html>

LAKSHIT 41221091
Page 10

LAKSHIT 41221091
OUTPUT

Using Get method accept details of a student & save it into student
table.

LAKSHIT 41221091
<!DOCTYPE html>
<html lang="en">
<head>
<title>Storing data</title>
</head>
<body>
<center>
<h1>Storing Form data in Database</h1>
<form action="insert.php" method="get">

<p>
<label for="firstName">First Name:</label>
<input type="text" name="first_name" id="firstName">
</p>

Page 11

LAKSHIT 41221091
<p>
<label for="lastName">Last Name:</label>
<input type="text" name="last_name" id="lastName">
</p>

<p>
<label for="Gender">Gender:</label>
<input type="text" name="gender" id="Gender">
</p>

<p>
<label for="Address">Address:</label>
<input type="text" name="address" id="Address">
</p>

<p>
<label for="emailAddress">Email Address:</label>
<input type="text" name="email" id="emailAddress">
</p>

<input type="submit" value="Submit">


</form>
</center>
</body>
</html>

Index.php
<!DOCTYPE html>
<html>

<head>
<title>Insert Page page</title>
</head>

<body>
<center>
<?php

// servername => localhost


// username => root
// password => empty
// database name => staff
$conn = mysqli_connect("localhost", "devilx", "devilx", "student");

// Check connection
if($conn === false){

LAKSHIT 41221091
Page 12

LAKSHIT 41221091
die("ERROR: Could not connect. "
. mysqli_connect_error());
}

// Taking all 5 values from the form data(input)


$first_name = $_REQUEST['first_name'];
$last_name = $_REQUEST['last_name'];
$gender = $_REQUEST['gender'];
$address = $_REQUEST['address'];
$email = $_REQUEST['email'];

// Performing insert query execution


// here our table name is college
$sql = "INSERT INTO college VALUES ('$first_name',
'$last_name','$gender','$address','$email')";

if(mysqli_query($conn, $sql)){
echo "<h3>data stored in a database successfully."
. " Please browse your localhost php my admin"
. " to view the updated data</h3>";

echo nl2br("\n$first_name\n $last_name\n "


. "$gender\n $address\n $email");
} else{
echo "ERROR: Hush! Sorry $sql. "
. mysqli_error($conn);
}

// Close connection
mysqli_close($conn);
?>
</center>
</body>

</html>

Using post method accept username & display new year greeting

<!DOCTYPE html>
<html>
<head>
<title>greeting using php</title>
</head>
<body>
<form method='POST'>
<h2>Please input your name:</h2>
<input type="text" name="name">
<input type="submit" value="Submit Name">

LAKSHIT 41221091
Page 13

LAKSHIT 41221091
</form>
<?php
//Retrieve name from query string and store to a local variable
$name = $_POST['name'];
echo "<h3> Happy new year $name </h3><br>";
echo "MAY THE UPCOMING YEAR ,<br> ";
echo "BRING HAPPINESS IN YOUR LIFE<br> ";
echo "BE HAPPY YOUR WELL WISHER <br>";
echo "DEVILX"
?>
</body>
</html>

OUTPUT

LAKSHIT 41221091
Page 14

LAKSHIT 41221091

You might also like