Experimentes
Experimentes
Program :-
<!DOCTYPE html>
<html>
<head>
<title>Student Registration Form</title>
<link rel="stylesheet" href="style.css">
<script>
function handleFormSubmit(event) {
event.preventDefault(); // Prevent the form from submitting normally
<tr>
<td>First Name:</td>
<td><input type="text" name="fname"></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type="text" name="lname"></td>
</tr>
<tr>
<td>Father's Name:</td>
<td><input type="text" name="fathername"></td>
</tr>
<tr>
<td>Mother's Name:</td>
<td><input type="text" name="mname"></td>
</tr>
<tr>
<td>Date of Birth:</td>
<td><input type="date" name="dob"></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="email" name="email"></td>
</tr>
<tr>
<td>Gender:</td>
<td>
<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female
</td>
</tr>
<tr>
<td>Choose Course:</td>
<td>
<select name="course">
<option value="">---Select---</option>
<option value="HTML">HTML</option>
<option value="PHP">PHP</option>
<option value="JAVA">JAVA</option>
<option value="ASP">ASP</option>
</select>
</td>
</tr>
<tr>
<td>Hobbies:</td>
<td>
<input type="checkbox" name="hobbies[]" value="singing"> Singing
<input type="checkbox" name="hobbies[]" value="dancing"> Dancing
<input type="checkbox" name="hobbies[]" value="reading"> Reading books
<input type="checkbox" name="hobbies[]" value="playing"> Playing Cricket
</td>
</tr>
<tr>
<td>Address:</td>
<td><textarea name="address"></textarea></td>
</tr>
<tr>
<td>Photo:</td>
<td><input type="file" name="photo"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Submit"></td>
</tr>
</table>
</form>
<h2>Using Blockquotes</h2>
<blockquote>
<p>This is a blockquote. It is used to indicate that the enclosed text is a quotation
from another source.</p>
</blockquote>
<h2>Using Lists</h2>
<h3>Unordered List:</h3>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<h3>Ordered List:</h3>
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
</div>
</body>
</html>
Output :-
Exp 2
Program :-
Program :-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Department of Computer Science</title>
<style>
/* Set the background color of the page */
body {
background-color: #c5af8d;
font-family: Arial, sans-serif;
margin: 20px;
}
/* Style for the header */
h1, h2, h3 {
color: #885e78;
}
/* Apply italics to the mission statement */
.mission {
font-style: italic;
}
/* Underline the vision statement */
.vision {
text-decoration: underline;
}
/* Different font for the list of programs */
.programs {
font-family: 'Courier New', Courier, monospace;
}
/* Different font for the contact information */
.contact {
font-family: 'Times New Roman', Times, serif;
}
/* Style for the back to top link */
.back-to-top {
display: block;
margin-top: 20px;
text-align: center;
}
</style>
</head>
<body>
<!-- Department Name -->
<h1 id="top">Department of Computer Science</h1>
<!-- Mission Statement -->
<h2>Mission</h2>
<p class="mission">To provide quality education and research opportunities in computer
science, fostering innovation and technological advancement.</p>
<!-- Vision Statement -->
<h2>Vision</h2>
<p class="vision">To be a leading department recognized globally for excellence in
computer science education and research.</p>
<!-- Programs Offered -->
<h2>Programs Offered</h2>
<ul class="programs">
<li>Bachelor of Technology in Computer Science</li>
<li>Master of Technology in Computer Science</li>
<li>Ph.D. in Computer Science</li>
</ul>
<!-- Faculty Information -->
<h2>Faculty</h2>
<ul>
<li>Prof. D.J Waghmare - Professor and Head of Department</li>
<li>Prof. G M Shaikh - Associate Professor</li>
<li>Prof. P B Khapale - Assistant Professor</li>
</ul>
<!-- Department Image with Link -->
<h2>Explore Our Campus</h2>
<p>Click on the image below to learn more about our campus facilities.</p>
<a href="https://www.stbcet.org.in" target="_blank">
<img src="Screenshot 2025-06-20 212931.png" alt="Department Building" width="600">
</a>
<!-- Contact Information -->
<h2>Contact Us</h2>
<p class="contact">
Department of Computer Science,<br>
Shri Tuljabhavani College of Engg.,<br>
Naldurg Road,<br>
Tuljapur, Maharashtra State, 413601<br>
Email: [email protected]<br>
Phone: (123) 456-7890
</p>
<!-- Back to Top Link -->
<a href="#top" class="back-to-top">Back to Top</a>
</body>
</html>
Output :-
Exp 3
Program :-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Regular Calculator</title>
<style>
body {
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: 'Segoe UI', sans-serif;
}
.calculator {
background-color: #222;
padding: 20px;
border-radius: 10px;
width: 300px;
}
#display {
width: 100%;
height: 60px;
font-size: 24px;
text-align: right;
padding: 10px;
border: none;
border-radius: 5px;
margin-bottom: 15px;
background-color: #eee;
box-sizing: border-box;
}
.buttons {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
button {
padding: 20px;
font-size: 18px;
border: none;
border-radius: 10px;
background-color: #444;
color: white;
cursor: pointer;
transition: 0.2s;
}
button:hover {
background-color: #666;
}
button.equal {
background-color: #2e8b57;
grid-column: span 1;
}
button.zero {
grid-column: span 2;
}
</style>
</head>
<body>
<div class="calculator">
<input type="text" id="display" readonly>
<div class="buttons">
<button onclick="clearDisplay()">AC</button>
<button onclick="deleteLast()">DEL</button>
<button onclick="appendValue('%')">%</button>
<button onclick="appendValue('/')">÷</button>
<button onclick="appendValue('7')">7</button>
<button onclick="appendValue('8')">8</button>
<button onclick="appendValue('9')">9</button>
<button onclick="appendValue('*')">×</button>
<button onclick="appendValue('4')">4</button>
<button onclick="appendValue('5')">5</button>
<button onclick="appendValue('6')">6</button>
<button onclick="appendValue('-')">−</button>
<button onclick="appendValue('1')">1</button>
<button onclick="appendValue('2')">2</button>
<button onclick="appendValue('3')">3</button>
<button onclick="appendValue('+')">+</button>
<script>
function appendValue(value) {
document.getElementById("display").value += value;
}
function clearDisplay() {
document.getElementById("display").value = "";
}
function deleteLast() {
let current = document.getElementById("display").value;
document.getElementById("display").value = current.slice(0, -1);
}
function calculate() {
try {
let result = eval(document.getElementById("display").value);
document.getElementById("display").value = result;
} catch {
alert("Invalid expression");
clearDisplay();
}
}
</script>
</body>
</html>
Output :-
Exp 4
Program :-
Main Program-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Employee Registration</title>
<style>
body {
font-family: 'Segoe UI', sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
overflow: hidden;
background: linear-gradient(45deg, #6a11cb, #2575fc);
background-size: 400% 400%;
animation: gradientAnimation 10s ease infinite;
}
@keyframes gradientAnimation {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
@keyframes particleAnimation {
0% { transform: translateY(0); opacity: 0.3; }
50% { transform: translateY(50px); opacity: 0.6; }
100% { transform: translateY(0); opacity: 0.3; }
}
.form-container {
position: relative;
background-color: rgba(255, 255, 255, 0.8);
padding: 30px;
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
width: 100%;
max-width: 400px;
backdrop-filter: blur(10px);
animation: slideIn 1s ease-out;
z-index: 2;
}
@keyframes slideIn {
from {
transform: translateY(-50%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
h1 {
text-align: center;
color: #fff;
font-size: 36px;
margin-bottom: 10px;
text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
}
h2 {
text-align: center;
color: #333;
font-size: 22px;
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 6px;
color: #666;
font-weight: bold;
font-size: 16px;
}
input[type="submit"] {
background-color: #2575fc;
color: white;
border: none;
cursor: pointer;
font-size: 14px;
padding: 10px;
border-radius: 10px;
transition: background-color 0.3s ease;
}
input[type="submit"]:hover {
background-color: #1a5ad9;
}
button {
width: 100%;
padding: 12px;
background-color: #2575fc;
color: white;
border: none;
border-radius: 10px;
font-size: 16px;
cursor: pointer;
text-align: center;
transition: transform 0.3s ease;
}
button:hover {
transform: scale(1.05);
background-color: #1a5ad9;
}
button a {
text-decoration: none;
color: white;
font-weight: bold;
}
button a:hover {
color: #fff;
text-decoration: underline;
}
</style>
<script>
function validateForm(event) {
event.preventDefault();
if (!emailPattern.test(email)) {
alert("Invalid email.");
return;
}
if (!mobilePattern.test(mobile)) {
alert("Mobile number must be 10 digits.");
return;
}
// Redirect to success.html
window.location.href = "success.html";
}
</script>
</head>
<body>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body, html {
height: 100%;
overflow: hidden;
font-family: Arial, sans-serif;
}
/* Video background */
video.bg-video {
position: fixed;
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
object-fit: cover;
z-index: -1;
}
/* Foreground content */
.content {
position: relative;
z-index: 1;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
color: white;
text-shadow: 0 0 10px rgba(0,0,0,0.7);
}
.box {
background: rgba(0, 0, 0, 0.5);
padding: 40px;
border-radius: 12px;
}
</style>
</head>
<body>
<label for="email">Email:</label>
<input type="email" id="email" required />
<label for="mobile">Mobile:</label>
<input type="text" id="mobile" required />
<label for="salary">Salary:</label>
<input type="text" id="salary" required />
<button><a href="success.html">Submit</a></button>
</form>
</div>
</div>
</body>
</html>
Success Page Program-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Success</title>
<style>
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(to right, #00c6ff, #0072ff);
color: white;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.message-box {
background: rgba(0, 0, 0, 0.3);
padding: 40px;
border-radius: 10px;
text-align: center;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}
h1 {
font-size: 32px;
margin-bottom: 15px;
}
p{
font-size: 18px;
}
a{
margin-top: 20px;
display: inline-block;
color: #fff;
text-decoration: underline;
}
</style>
<script>
window.onload = function () {
const name = localStorage.getItem("employeeName");
document.getElementById("employeeName").textContent = name ? name : "Employee";
localStorage.removeItem("employeeName"); // clear after showing
}
</script>
</head>
<body>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body, html {
height: 100%;
overflow: hidden;
font-family: Arial, sans-serif;
}
/* Video background */
video.bg-video {
position: fixed;
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
object-fit: cover;
z-index: -1;
}
/* Foreground content */
.content {
position: relative;
z-index: 1;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
color: white;
text-shadow: 0 0 10px rgba(0,0,0,0.7);
}
.box {
background: rgba(0, 0, 0, 0.5);
padding: 40px;
border-radius: 12px;
}
</style>
</head>
<body>
h1 {
color: #333;
margin-bottom: 20px;
}
.card {
background: white;
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
border-radius: 12px;
padding: 20px 30px;
width: 100%;
max-width: 400px;
margin: 10px;
transition: transform 0.3s ease;
}
.card:hover {
transform: translateY(-4px);
}
label {
font-weight: 600;
}
input {
width: 100%;
padding: 10px;
margin: 10px 0 15px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 16px;
}
button {
background-color: #4a90e2;
color: white;
padding: 10px 20px;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #357ab8;
}
.output {
font-weight: bold;
margin-top: 10px;
color: #444;
}
</style>
</head>
<body>
<div class="card">
<label for="stringInput">Enter a String:</label>
<input type="text" id="stringInput" placeholder="Type something...">
<button onclick="showStringLength()">Get String Length</button>
<div class="output" id="stringOutput"></div>
</div>
<div class="card">
<label for="numberInput">Enter a Number:</label>
<input type="number" id="numberInput" placeholder="Type a number...">
<button onclick="reverseDigits()">Reverse Digits</button>
<div class="output" id="numberOutput"></div>
</div>
<script>
function showStringLength() {
const input = document.getElementById("stringInput").value;
const length = input.length;
document.getElementById("stringOutput").innerText = `Length: ${length}`;
}
function reverseDigits() {
const input = document.getElementById("numberInput").value;
if (input === "") {
document.getElementById("numberOutput").innerText = "Please enter a number.";
return;
}
const reversed = input.split('').reverse().join('');
document.getElementById("numberOutput").innerText = `Reversed: ${reversed}`;
}
</script>
</body>
</html>
Output :-
Exp 6
Program :-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Prime Finder</title>
<style>
body {
font-family: 'Segoe UI', sans-serif;
margin: 0;
padding: 0;
background: linear-gradient(to right top, #a1c4fd, #c2e9fb);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
}
h1 {
color: #2c3e50;
margin-bottom: 20px;
}
.card {
background: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(12px);
border-radius: 20px;
padding: 30px;
max-width: 450px;
width: 100%;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.card:hover {
transform: scale(1.02);
}
label {
font-weight: 600;
color: #34495e;
}
input {
width: 100%;
padding: 12px;
margin: 10px 0 20px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 16px;
}
button {
background-color: #3498db;
color: white;
padding: 12px 20px;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
width: 100%;
}
button:hover {
background-color: #2980b9;
}
.output {
margin-top: 20px;
font-weight: 500;
color: #2d3436;
word-wrap: break-word;
}
</style>
</head>
<body>
<div class="card">
<label for="start">Starting Number:</label>
<input type="number" id="start" placeholder="e.g., 10">
<script>
function isPrime(n) {
if (n < 2) return false;
for (let i = 2; i <= Math.sqrt(n); i++) {
if (n % i === 0) return false;
}
return true;
}
function findPrimes() {
const start = parseInt(document.getElementById("start").value);
const end = parseInt(document.getElementById("end").value);
const result = document.getElementById("result");
let primes = [];
if (isNaN(start) || isNaN(end)) {
result.innerHTML = "❗ Please enter valid numbers.";
return;
}
</body>
</html>
Output :-
Exp 7
Program :-
<!DOCTYPE html>
<html>
<head>
<title>Digital Clock - PHP Server Time</title>
<style>
body {
background-color: #1e1e1e;
color: #00ffcc;
font-family: 'Courier New', monospace;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.clock {
font-size: 110px;
background: #000;
padding: 30px 50px;
border-radius: 15px;
box-shadow: 0 0 20px #00ffcc;
}
</style>
</head>
<body>
<script>
// Start from current server time
let timeParts = document.getElementById("clock").innerText.split(":");
let hours = parseInt(timeParts[0]);
let minutes = parseInt(timeParts[1]);
let seconds = parseInt(timeParts[2]);
function updateClock() {
seconds++;
if (seconds >= 60) {
seconds = 0;
minutes++;
}
if (minutes >= 60) {
minutes = 0;
hours++;
}
if (hours >= 24) {
hours = 0;
}
setInterval(updateClock, 1000);
</script>
<script>
// Update the clock every second
setInterval(function() {
let now = new Date();
let hours = now.getHours().toString().padStart(2, '0');
let minutes = now.getMinutes().toString().padStart(2, '0');
let seconds = now.getSeconds().toString().padStart(2, '0');
document.getElementById("clock").innerHTML = hours + ":" + minutes + ":" +
seconds;
}, 1000);
</script>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
overflow: hidden;
font-family: Arial, sans-serif;
}
h1 {
font-size: 3em;
margin: 0;
}
p{
font-size: 1.5em;
}
</style>
</head>
<body>
</body>
</html>
Output :-
Exp 8
Program :-
<?php
session_start();
// Handle sign in
if (isset($_POST['signin'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$image_info = getimagesize($file_tmp);
if ($image_info !== false) {
$image_type = $image_info[2];
$width = 100;
$height = 130;
if ($src_image) {
$dst_image = imagecreatetruecolor($width, $height);
imagecopyresampled($dst_image, $src_image, 0, 0, 0, 0, $width, $height,
$image_info[0], $image_info[1]);
imagejpeg($dst_image, $target_file);
imagedestroy($src_image);
imagedestroy($dst_image);
$_SESSION['profile_pic'] = $target_file;
$upload_message = "Profile picture uploaded and resized!";
}
} else {
$upload_message = "Invalid image file.";
}
} else {
$upload_message = "Error uploading file.";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Stylish Dashboard</title>
<style>
body {
margin: 0;
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(135deg, #e0eafc, #cfdef3);
}
.navbar {
background-color: #2C3E50;
padding: 15px 30px;
color: white;
display: flex;
justify-content: space-between;
align-items: center;
}
.navbar h1 {
margin: 0;
font-size: 24px;
}
.navbar input[type=submit] {
padding: 8px 16px;
border-radius: 5px;
border: none;
background: #E74C3C;
color: white;
cursor: pointer;
}
.main-content {
padding: 40px 20px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 30px;
max-width: 1100px;
margin: auto;
}
.card {
background: white;
border-radius: 15px;
padding: 25px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
transition: transform 0.2s;
}
.card:hover {
transform: translateY(-5px);
}
.card h2 {
color: #34495E;
margin-bottom: 10px;
}
.card p {
color: #666;
}
.profile-pic {
width: 100px;
height: 130px;
border-radius: 8px;
object-fit: cover;
margin-bottom: 10px;
border: 2px solid #3498DB;
}
.quick-links button {
background-color: #3498DB;
color: white;
border: none;
padding: 10px 15px;
margin: 5px;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s;
}
.quick-links button:hover {
background-color: #2980B9;
}
.form-container {
background: white;
padding: 30px;
max-width: 400px;
margin: 80px auto;
border-radius: 15px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px;
margin-top: 10px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 8px;
}
input[type=submit] {
background-color: #3498DB;
color: white;
padding: 12px;
border: none;
border-radius: 8px;
width: 100%;
font-size: 16px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #2980B9;
}
.error {
color: red;
margin-bottom: 15px;
}
.upload-msg {
color: green;
margin-top: 10px;
}
</style>
</head>
<body>
<?php if (isset($_SESSION['username'])): ?>
<div class="navbar">
<h1>Welcome, <?= htmlspecialchars($_SESSION['username']) ?>!</h1>
<form method="post">
<input type="submit" name="signout" value="Sign Out">
</form>
</div>
<div class="main-content">
<div class="card">
<h2>🎉 Dashboard</h2>
<p>This is your personalized dashboard. Explore tools and features tailored for
you.</p>
</div>
<div class="card">
<h2>👤 Profile</h2>
<?php if (isset($_SESSION['profile_pic']) &&
file_exists($_SESSION['profile_pic'])): ?>
<img src="<?= $_SESSION['profile_pic'] ?>" class="profile-pic" alt="Profile
Picture">
<?php else: ?>
<img src="https://via.placeholder.com/100x130?text=No+Image" class="profile-
pic" alt="Default Profile">
<div class="card">
<h2>📋 To-Do List</h2>
<ul>
<li>✔️Complete dashboard UI</li>
<li>🔧 Add settings page</li>
<li>📤 Upload profile picture</li>
</ul>
</div>
</body>
</html>
Output :-