Web Technology - ISolved Practical Slips
Web Technology - ISolved Practical Slips
Web Technology - I
Solved Practical Slips
2022-23
Follow us on Instagram
@logic_overflow
Solution:
<html>
<head>
<title>slip 1</title>
<style>
body{background-color: yellow;}
table {background-color: turquoise;}
h3 { font-size: 6pt; color:red;}
</style>
</head>
<body>
<center>
<h3> Project Management </h3>
<table border="3" height="200px" width="400px">
<form name=frmlogin><br>
<tr><td>Enter Project Name:</td><td><input type=text name=t1
placeholder=projectname><br><br></td></tr>
<tr><td>Assignned to:</td><td><select name="Names" id="nm" form="frmlogin">
<option value="ross">Ross Geller</option>
<option value="chuck">Chuck Bass</option>
<option value="rachel">Rachel Green </option>
<option value="dan">Dan James</option>
</select></td></tr>
<tr><td>Priority:</td><br>
<td><input type=radio name=ck value="high">High<br>
<input type=radio name=ck value="avg">Average <br>
<input type=radio name=ck value="low">Low</td></tr>
Solution:
<html>
<head>
<title>PUNE</title>
<body style="background-color:Pink;">
<h3 style="font-size:100px; color:blue;"> PUNE</h3>
<ul>
<li style="color:brown; font-style: italic;">Dagadu Seth Ganpati Temple</li>
<li style="color:red; font-style: oblique;">Saras Baug Temple</li>
<li style="color:purple; font-style: italic;">Phoenix Market City Pune</li>
</ul>
<img src="https://mittalbuilders.com/wp-content/uploads/2020/12/Reasons-to-
settle-down-in-Pune.png" width="200" height="200" align="bottom">
Slip 3:
Write a program using html with following CSS specifications-
<html>
<head>
<title>Accenture</title></head>
<body style="background-color:#4CBB17">
<h3 style="font-size:60px; color:red; font-style:Comic Sans MS "> Accenture</h3>
<p style=" color:blue; font-size:25px">Accenture plc is an Irish-American professional
services company based in Dublin,
specializing in information technology (IT) services and consulting.<br>
As of 2022,Accenture is considered
the largest consulting firm in the world by number of employees.<br>
Accenture is a $61.6-billion-in-annual-revenue technology and consulting company
incorporated in Dublin, Ireland.
Led by Chair & CEO Julie Sweet, who prior to her promotion in 2019 served as CEO of
Accentures business in North America,
the Fortune Global 500 information technology services company has supplemented its
growth
through high-profile acquisitions like that of ad agency Droga5. With 721,000 people
worldwide</p>
</html>
</head>
<body>
<div class="jumbotron">
<center><h1>My First Bootstrap Page</h1></center>
<center><p>This is responsive</p></center>
</div>
<div class="row">
<div class="col-3 offset-1 bg-light">
<h4>Personal Information</h4>
<p>name</p>
</div>
<div class="col-3 offset-1 bg-light">
<h4>Educational Information</h4>
<p>name</p>
</div>
<body>
<div class="row ">
<div class="col-12 bg-primary">
<h3>header</h3>
</div>
</div>
<div class="row">
<div class="col-4 bg-info">
<h4>Menu</h4>
</div>
<div class="col-8 bg-warning ">
<p>this is collge information</p>
</div>
</div>
<div class="row">
<div class="col-12 bg-danger">
<h3>Footer</h3>
</div>
</div>
</body>
</html>
Slip7 Design HTML 5 Page Using CSS Which Displays the following Navigation Bar
<html>
<head>
<title>Navigation Bar</title>
<style>
li {
display:inline;
}
</style>
</head>
<body style="font-size:40px">
<ul>
HTML FILE
<html>
<body>
<form action="slip_8.php" method="get">
enter first string:<input type="text" name="str1"><br>
enter second string:<input type="text" name="str2"><br>
<input type="submit" value="submit">
</form>
</body>
</html>
PHP FILE
<?php
$a=$_GET["str1"];
$b=$_GET["str2"];
//$len1=strlen($a);
//$len2=strlen($b);
if(strcasecmp($a,$b)==0)
echo "Both Strings are equal<br>";
else if(strcasecmp($a,$b)>0)
echo "first string bigger<br>";
else
echo "second string is bigger<br>";
?>
Slip9: Write a PHP script for the following: Design a form having a text box and a drop
down listcontaining any 3 separators(e.g. #, |, %, @, ! or comma) accept a strings from the
user and also aseparator.
a. Split the string into separate words using the given separator.
b. Replace all the occurrences of separator in the given string with some other separator.
c. Find the last word in the given string.
HTML FILE
<html>
<body>
<form action="slip_9.php"method="get">
Enter a string:<input type="text" name="str1"><br>
choose a label
<select name="sep" id="sep">
<option value="#">#</option>
<option value="!">!</option>
<option value="@">@</option>
</select><br>
<input type="radio" name="op" value="a">Split The String Using The Seperator<br>
<input type="radio" name="op" value="b">Replace The Occurences Of The
Seperator With Another Seperator<br>
<input type="radio" name="op" value="c">Find The Last Word Of The String<br>
<input type="submit"value="submit">
</form>
</body>
</html>
PHP FILE
<?php
$str=$_GET['str1'];
$sep=$_GET['sep'];
$op=$_GET['op'];
case 'b':
$cnt=substr_count($str,$sep);
$n=str_replace($sep,"!",$str,$cnt);
echo "After changing separators<br>";
echo $n;
break;
HTML FILE
<html>
<head>
<title>Assignment 3 Q1</title>
</head>
<body>
<form action="slip10.php" value="GET">
Select An Operation<br>
<input type="radio" name="op" value="mod">Mod Of The Two Numbers<br><br>
</form>
</body>
</html>
PHP FILE
<?php
$n1=$_GET["n1"];
$n2=$_GET["n2"];
$op=$_GET["op"];
function mod($n1,$n2)
{
$n3=0;
if($n2!=0)
$n3=$n1%$n2;
return $n3;
}
function power($n1,$n2)
{
$n3=1;
for($i=1;$i<=$n2;$i++)
$n3=$i*$n1;
return $n3;
}
function sum($n1)
{
$n3=0;
for($i=1;$i<=$n1;$i++)
{
$n3=$n3+$i;
}
return $n3;
}
function fact($n2)
{
$n3=1;
for($i=1;$i<=$n2;$i++)
{
$n3=$n3*$i;
Slip11: Create a button with different style (Secondary, Primary, Success, Error, Info,
Warning, Danger) using BootStrap.
<html>
<head>
<link rel=stylesheet href="bootstrap.min.css">
</head>
<body>
<form >
<input type= button value="primary" class="btn btn-primary">
<input type= button value="warning" class="btn btn-warning">
<input type= button value="secondary"class="btn btn-Secondary">
<input type= button value="success" class="btn btn-success">
<input type= button value="info" class="btn btn-info">
<input type= button value="danger" class="btn btn-danger">
</body>
</html>
Slip12: Write a PHP script for the following: Design a form to accept two numbers from the
user. Give options to choose the arithmetic operation (use radio buttons). Display the result
on the nextform. (Use the concept of function and default parameters. Use ‘include’ construct
or require statement)
PHP FILE
function add($x=4,$y=2)
{
$result=$x+$y;
echo"adition is $result";
}
function sub($x=4,$y=2)
{
$result=$x-$y;
echo"subtraction is $result";
}
switch ($op)
{
case"1": add($x,$y);
break;
case"2": sub($x,$y);
break;
}
?>
HTML FILE
<html>
<body>
<form action="slip12in.php"method="POST">
first number
<input type=text name=s2><br>
second number
<input type=text name=s1><br>
chose opration from below<br>
addition
<input type=radio value="1" name=op> <br>
subtraction
<input type=radio value="2"name=op> <br>
<input type= submit value="submit"><br>
</body>
</html>
PHP FILE
<?php
include'slip12.php';
?>
<html>
<head>
<head><title>NRC ChessBoard</title>
<style>
.clr1
{
background-color:black;
}
.clr2
{
background-color:white;
}
table
{
width:100%;
height:100%;
}
</style>
<?php
echo"<table border=1>";
for($i=1;$i<=8;$i++)
{
echo"<tr>";
if($i%2==0)
{
for($j=1;$j<=8;$j++)
{
if($j%2==1)
echo"<td class=clr2></td>";
else
echo"<td class=clr1></td>";
}
}
else
{
for($j=0;$j<8;$j++)
{
if($j%2==0)
echo"<td class=clr1></td>";
else
echo"<td class=clr2></td>";
}
?>
</html>
Slip14: Create a container add row inside it and add 3 columns inside row using BootStrap.
<html>
<head>
<link rel="stylesheet" href="bootstrap.min.css">
</head>
<body>
<div class=container>
HTML FILE
<html>
<body>
<form action="Slip15.php" method=get>
Enter a String<input type=text name=t1><br>
<input type=radio name=op value=1>Select 5 words<br>
<input type=radio name=op value=2>LowerCase<br>
<input type=radio name=op value=3>Padding<br>
<input type=radio name=op value=4>Remove Spaces<br>
PHP FILE
<?php
$str=$_GET['t1'];
$ch=$_GET['op'];
if($ch==1)
{
$ar=explode(" ",$str,6);
foreach($ar as $a)
echo "$a<br>";
}
else if($ch==2)
{
$str=strtolower($str);
echo $str;
$str=ucwords($str);
echo "<br>$str";
}
else if($ch==3)
{
$str=str_pad($str,20,"*",STR_PAD_BOTH);
echo $str;
}
else if($ch==4)
{
$str=trim($str);
echo $str;
}
else if($ch==5)
{
$str=strrev($str);
echo $str;
}
?>
<?php
$a =$_GET['v1'];
$b =$_GET['v2'];
$c =$_GET['v3'];
$sum=0;
echo "<h1> <center>Marksheet</center></h1>";
echo "<h3><center>student id:$a</h3><br>";
$d =explode(",",$b);
$e =explode(",",$c);
echo "<center><table border=2 width=50%>";
for($i=0;$i<=4;$i++)
{
echo "<tr>
<td>$d[$i]</td>
<td>$e[$i]</td>
</tr>";
$sum=$e[$i]+$sum;
}
$result=$sum/5;
echo "<tr><td>Total marks </td><td>$sum</td>";
echo"<tr><td>Percentage</td><td>$result</td></tr>";
echo "</center>"
?>
<?php
$a = array("Sagar"=>"31","Vicky"=>"41","Leena"=>"39","Ramesh"=>"40");
echo "sorting in ascending order by value<br>";
asort($a);
print_r($a);
echo "sorting in ascending order by key<br>";
ksort($a);
print_r($a);
echo "sorting in decending order by value<br>";
arsort($a);
print_r($a);
echo "sorting in decending order by key<br>";
krsort($a);
print_r($a);
?>
Slip18: Write a menu driven program to perform the following operations on an associative
array
a. Reverse the order of each element’s key-value pair.
b. Traverse the element in an array in random order.
c. Convert the array elements into individual variables.
d. Display the elements of an array along with key.
HTML FILE
<html>
<head>
<title> String operations </title>
<body>
HTML FILE
<html>
<form action=slip19.php method=get>
Enter a Sentence<input type=text name=t1><br>
Enter a word<input type=text name=t2><br>
Enter position<input type=text name=t3><br>
Enter number of characters to remove<input type=text name=t4><br>
<input type=submit value="Display Result">
</form>
</html>
PHP FILE
<?php
$st=$_GET['t1'];
$wd=$_GET['t2'];
$ps=$_GET['t3'];
$nr=$_GET['t4'];
$dup_st=$st;
$str=substr_replace($st,"",$ps,$nr);
echo "<br>$str<br>";
$str=substr_replace($st,$wd,$ps,0);
echo "<br>$str<br>";
$str=substr_replace($st,$wd,$ps,strlen($wd));
echo "<br>$str<br>";
?>
Slip20: Write a menu driven program to perform the following operations on associative
arrays:
a) Split an array into chunks
b) Sort the array by values without changing the keys.
c) Filter the even elements from an array.
HTML FILE
<html>
<body>
<?php
$choice=$_GET['ch'];
$arr=array('a'=>1,'b'=>20,'c'=>13,'d'=>5,'e'=>18,'f'=>12,'g'=>7,'h'=>8,'i'=>15,'j'=>10);
switch($choice)
{
case 1:
print_r(array_chunk($arr,2));
break;
case 2:
asort($arr);
echo "Array in ascending order:<br>";
print_r($arr);
break;
case 3:
function even($var)
{
return $var%2==0?1:0;
}
$br=array_filter($arr,"even");
print_r($br);
break;
}
?>
Slip21: Create an array of 15 high temperatures, approximating the weather for a spring
month, then find the average high temp, the five warmest high temps Display the result on the
browser
HTMl FILE
<html>
<body>
<form method=get action="slip 23.php">
<input type=radio name=ch value=1> Insert in queue<br>
Enter No to insert<input type=text name=n1><br>
<input type=radio name=ch value=2> Delete in queue<br>
<input type=radio name=ch value=3> Display<br>
<input type=submit>
</form>
</body>
</html>
PHP FILE
HTML FILE
<html>
<body>
<form method=get action="slip23.php">
<input type=radio name=ch value=1> Insert in stack<br>
Enter No to insert<input type=text name=n1><br>
<input type=radio name=ch value=2> Delete in stack<br>
<input type=radio name=ch value=3> Display<br>
<input type=submit>
</form>
</body>
</html>
PHP FILE
<?php
$stk=array(1,2,3,4,5);
$ch=$_GET['ch'];
if($ch==1)
{
Slip24: Write a PHP program to read two file names from user and append content of first
file intosecond file.
HTML FILE
<html lang="en">
<head>
<title>NRC File Handling</title>
</head>
<body>
<form action="slip24.php" method="get">
Enter File name to read <input type="text" name="fname1">
Enter File name to write <input type="text" name="fname2">
<input type="submit" value="Copy">
</form>
</body>
</html>
PHP FILE (create 2 text file pf your choice name and use same)
<?php
$fname1=$_GET['fname1'];
$fname2=$_GET['fname2'];
$fp1=fopen($fname1,"r");
$fp2=fopen($fname2,"a");
$size=filesize($fname1);
$str=fread($fp1,$size);
HTML FILE
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<form action="slip25.php" method="get">
Enter File name to read <input type="text" name="fname1"><br>
<input type="radio" name="op" value="1">Display Type of File<br>
<input type="radio" name="op" value="2">Display Modification Time<br>
<input type="radio" name="op" value="3">Display File Size<br>
<input type="radio" name="op" value="4">Delete File<br>
<input type="submit" value="Copy">
</form>
</body>
</html>
PHP FILE
<?php
$fp=$_GET['fname1'];
$op=$_GET['op'];
switch($op)
{
case 1:
echo basename($fp);
break;
case 2: $mtime=stat($fp);
echo Date("d/M/Y h:m:s",$mtime['mtime']);
break;
case 3:echo filesize($fp);
break;
case 4:unlink($fp);
echo "File deleted";
break;
}
</form>
</html>
PHP File
<?php
while($row=pg_fetch_array($rs))
{
echo "Id:$row[0] Name:$row[1] Address:$row[2] City:$row[3]
Pin:$row[4]<br>";
}
?>
Slip27: Write a PHP program to read two file names from user and copy the content of first
file into second file.
HTML FILE
<html lang="en">
<head>
<title>NRC File Handling</title>
</form>
</body>
</html>
PHP FILE
<?php
$fname1=$_GET['fname1'];
$fname2=$_GET['fname2'];
$fp1=fopen($fname1,"r");
$fp2=fopen($fname2,"w");
$size=filesize($fname1);
$str=fread($fp1,$size);
fwrite($fp2,$str,$size);
echo "Append Successfull";
?>
Slip28: Write a program to read a flat file “student.dat”, calculate the percentage and
display the data from file in tabular format.(Student.dat file contains rollno, name, OS, WT,
DS, Python, Java, CN )
Student.dat file
1 Abd 30 30 25 23 20 45
2 xyz 32 33 24 25 25 45
PHP FILE
<?php
$fp=fopen("student.dat","r");
$ar=fscanf($fp,"%s%s%s%s%s%s%s%s",$rl,$nm,$os,$wt,$ds,$py,$jv,$cn);
while(($ar=fscanf($fp,"%s%s%d%d%d%d%d%d",$rl,$nm,$os,$wt,$ds,$py,$jv,$cn))!=f
alse)
$total=$os+$wt+$ds+$py+$jv+$cn;
$per=$total/6;
echo
"<tr><th>$rl</th><th>$nm</th><th>$os</th><th>$wt</th><th>$ds</th><th>$py</t
h><th>$jv</th><th>$cn</th><td>$per</td></tr>";
echo "</table>";
?>
Slip29:
Consider the following entities and their relationships
Event (eno , title , date )
Committee ( cno , name, head , from_time ,to_time , status)
Event and Committee have many to many relationship. Write a php script to accept title of
eventand modify status committee as working
HTML File
<html>
</form>
</html>
PHP File
<?php
$en=$_GET['t1'];
$ws='Working';
if($x>0)
echo "Working status updated";
else
echo "Status not updated";
?>
Slip30:
Consider the following entities and their relationships
Student (Stud_id,name,class)
Competition (c_no,c_name,type)
Relationship between student and competition is many-many with attribute rank and year.
Createa RDB in 3NF for the above and solve the following. Using above database write a
script in PHPto accept a competition name from user and display information of student
who has secured 1st rank in that competition.
HTML File
<html>
</form>
</html>
PHP File
<?php
$cn=$_GET['t1'];
while($row=pg_fetch_array($rs))
?>
www.nrclassespune.com | www.bcsbca.com
Subscribe to our YouTube Channel for BCS Study videos
https://www.youtube.com/@NRClasses
Click on the below link to join our Free Study Material WhatsApp Group
https://chat.whatsapp.com/J8vwXvDl2EW9htNH0LckU9