Uploaded by roypratik2810

AWPALLexp

advertisement
INDEX
Sl.
No.
Date
Name of the Experiment
Page
No.
1.
Write an HTML code to display
your CV on a web page.
2.
Write an HTML code to create a 5-8
Registration Form. On submitting
the form, the user should be
asked to login with this new
credentials.
Write an HTML code to create a 9-11
frameset having header,
navigation and content sections.
3.
1-4
4.
Write a Java script to prompt for 12-14
users name and display it on
sssthe screen.
5.
Validate form page using
JavaScript.
6.
Write a program to Count the
18-20
number of milliseconds between
the two click events on a
paragraph
7.
21-24
8.
9.
10.
Create an simple application using
AJAX to show the table of
numbers given by user at
runtime.
15-17
Develop student registration web 25-28
appication using PHP.
Create a PHP application with an 29-32
HTML form for users to submit
comments, a PHP script to add
comments to a database, and
another PHP script to display all
submitted comments.
Create a XML document and
also apply DTD to it.
33-35
Remark
Faculty
Signature
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : Write an HTML code to display your CV on a web page.
1. Define the HTML Document:
•
Start with the HTML document declaration: <!DOCTYPE html>
•
Create the HTML opening and closing tags: <html> and </html>
2. Head Section:
•
Include the head section between <head> and </head> tags.
•
Set the title of the document within <title> tags.
3. Style Section:
•
Optionally, include a style section within <style> tags to add some CSS styling for
your CV.
4. Body Section:
•
Start the body section between <body> and </body> tags.
•
Divide the CV into sections using appropriate HTML elements like <div>, <h1>,
<h2>, <p>, <ul>, <li>, etc.
•
Include your personal information, education, work experience, skills, and any other
relevant details.
5. Add Links or Buttons:
•
If needed, include links or buttons for downloading a PDF version of your CV or
linking to other relevant pages.
6. Save and Test:
•
Save your HTML file with an appropriate name and the ".html" extension.
•
Open the file in a web browser to test the layout and appearance.
Testing Phase: Compilation of Code (error detection)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Cv</title>
<style>
#objective{
width: 500px;
color: rgb(43, 177, 226);
}
#footer{
background-color: rgb(98, 96, 226);
height: 100px;
text-align: center;
}
body{
background-color: rgb(76, 103, 103,0.5);
}
</style>
</head>
<body>
<h1 style="color: rgb(218, 58, 146);"> MADHAV SAMEER</h1>
<img src="profile.jpeg" alt="Your photo" width="120px" height="150px" style="border-radius: 10px;">
<div id="objective" >
<h3 style="background-color: rgb(208, 234, 230);" >I am an Enthusiastic software developer with a
passion for creating innovative web and
software technologies using my technical skills
and creativity in a dynamic team-oriented
Environmnet. I want to continuously learn and
grow in the ever-evolving field of technology.</h3>
</div>
<div id="eudcation">
<table border="10px" >
<th bgcolor="blueviolet">Degree</th>
<th bgcolor="blueviolet">Institution Name</th>
<th bgcolor="blueviolet">Duration</th>
<tr>
<td>Btech</td>
<td>Centurion University of technology and mangement</td>
<td>2021-25</td>
</tr>
<tr>
<td>Intermediate</td>
<td>Ramkrishna Dwarika college</td>
<td>2019-21</td>
</tr>
<tr>
<td>Matriculation</td>
<td>Holy Faith International Public school</td>
<td>2019</td>
</tr>
</table>
</div>
<section>
<h2>Contact Information</h2>
<p>Email: madhavsameer97@gmail.com</p>
<p>Phone: +916200359817</p>
<p>LinkedIn: <a href="https://www.linkedin.com/in/madhavsameer"
target="_blank">linkedin.com/in/Madhavsameer</a></p>
<p>GitHub: <a href="https://github.com/madhavsameer"
target="_blank">github.com/Madhavsameer</a></p>
</section>
<div id="skills">
<h3>My Skills</h3>
<ul>
<li>JAVA</li>
<li>JAVASCRIPT</li>
<li>REACT JS</li>
<li>HTML</li>
<li>CSS</li>
</ul>
</div>
<section>
<h2>Work Experience</h2>
<p> <strong>Bharat Intern</strong>, Location - Remote, Position- WEB DEVELOPER</p>
<ul>
<li>Worked on developing a Portfolio website</li>
<li>Created a responsive and beautiful calculator</li>
</ul>
<p> <strong>Oasis infobyte</strong>, Location - Remote, Position- WEB DEVELOPER</p>
<ul>
<li>Worked on developing a Weather app using Open Weather API</li>
<li>Created a FullStack landing page with Login and Register Option</li>
</ul>
</section>
<section>
<h2>Languages</h2>
<p>English (Fluent), Hindi (Mother Tongue)</p>
</section>
<footer id="footer">
<p id="message">Copyright @2024 | Designed & Developed by Madhav sameer with ❤️</p>
</footer>
</body>
</html
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : Write an HTML code to create a Registration Form. On submitting
the form, the user should be asked to login with this new credentials.
Coding Phase: Pseudo Code / Flow Chart / Algorithm
Registration Form (registration.html):
•
Create a new HTML file and name it registration.html.
Define the HTML document structure with <!DOCTYPE html>, <html>, <head>, and
<body> tags.
Inside the <body> section, create a form using the <form> element.
Include form fields for user registration, such as username, email, password, etc.
•
Add a submit button.
•
•
•
Login Form (login.html):
•
Create a new HTML file and name it login.html.
•
Define the HTML document structure with <!DOCTYPE html>, <html>, <head>, and
<body> tags.
Inside the <body> section, create a form using the <form> element.
•
•
•
Include form fields for user registration, such as username, password.
Add a Login button.
Testing Phase: Compilation of Code (error detection
Registration.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register & login</title>
</head>
<body>
<h1>Registration form</h1>
<form action="login.html">
<div id="Myform" style="margin-top: 20px; margin-left: 40px;">
<input type="text" name="Name" id="name" placeholder="Name">
<br>
<input type="text" name="Email" id="email" placeholder="Email">
<br>
<input type="password" name="pw" placeholder="Password" id="pw">
<br>
<input type="password" name="cpw" placeholder="Confirm-Password" id="cpw">
<br>
<button type="submit" onclick="login.html">Submit </button>
</div>
</form>
</body>
</html>
Login.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login form</title>
</head>
<body>
<form action="" method="get">
<input type="text" name="Email" id="email" placeholder="Email">
<br>
<input type="password" name="pw" placeholder="Password" id="pw">
<br>
<button>Login</button>
</form>
</body>
</html>
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : Write an HTML code to create a frameset having header, navigation and
content sections.
Coding Phase: Pseudo Code / Flow Chart / Algorithm
Create the Main HTML File (index.html):
•
Create a new HTML file and name it index.html.
•
Define the HTML document structure with <!DOCTYPE html>, <html>, <head>,
and <title> tags.
•
Inside the <body> section, use the <frameset> element to create the layout.
Create Header, Navigation, and Content HTML Files:
•
Create three separate HTML files for the header, navigation, and content sections
(e.g., header.html, navigation.html, and content.html).
•
Customize the content of each file according to your requirements.
Testing Phase: Compilation of Code (error detection)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>frameset</title>
</head>
<body>
<header>
<h1>FrameSet Example Page</h1>
</header>
<nav>
<a href="aboutus.html">About us</a>
<a href="ourservices.html">Our Services</a>
<a href="contactus.html">Contact us</a>
</nav>
<div id="content">
<img src="https://th.bing.com/th/id/OIP.m4FmOjk0BxN4JaBzsBoTgHaEP?rs=1&pid=ImgDetMain" alt="image not loaded">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ullam minus voluptas voluptates eius,
laborum ratione. Fugiat, autem quidem porro cumque ullam qui eos adipisci rerum accusantium.</p>
</div>
<footer>
© 2024 Madhav Sameer| Privacy Policy | Terms of Use
</footer>
</body>
</html>
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : - Write a Java script to prompt for users name and
display it on the screen.
Coding Phase: Pseudo Code / Flow Chart / Algorithm
1. Display a message to prompt the user for their name.
2. Read and store the user's input in a variable.
3. Check if the input is not empty.
• If not empty, display a personalized greeting.
• If empty, display a default greeting for an anonymous user.
4. End.
Testing Phase: Compilation of Code (error detection)
First.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome display</title>
</head>
<body>
<h1 id="mess"> </h1>
<script>
let name=prompt("What is your name?");
let Message=document.querySelector('#mess');
Message.innerHTML=(`Hello ${name}`);
</script>
</body>
</html>
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : Validate form page using JavaScript
Coding Phase: Pseudo Code / Flow Chart / Algorithm
1. Start
2. Function validateForm():
a. Get the values of the input fields (firstName, lastName, email).
b. Check if any of the fields are empty:
i. If any field is empty, display an alert "All fields must be filled out" and
return false.
c. Use a regular expression to validate the email format:
i. If the email is not in a valid format, display an alert "Please enter a
valid email address" and return false.
d. If all validations pass, return true.
3. End
Testing Phase: Compilation of Code (error detection)
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Validation</title>
</head>
<body>
<form onsubmit="return validateForm()">
<label for="firstName">First Name:</label>
<input type="text" id="firstName" required>
<label for="lastName">Last Name:</label>
<input type="text" id="lastName" required>
<label for="email">Email:</label>
<input type="email" id="email" required>
<label for="password">Password:</label>
<input type="password" id="password" required>
<button type="submit">Submit</button>
</form>
<script>
function validateForm() {
var firstName = document.getElementById('firstName').value;
var lastName = document.getElementById('lastName').value;
var email = document.getElementById('email').value;
var password = document.getElementById('password').value;
if (!firstName || !lastName || !email || !password) {
alert('All fields are required');
return false;
}
// Simple email validation regex
var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(email)) {
alert('Please enter a valid email address');
return false;
}
if (password.length < 8) {
alert('Password must be at least 8 characters long');
return false;
}
// Additional validation or form submission logic can be added here
alert('Form submitted successfully!');
return true;
}
</script>
</body>
</html>
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : Write a program to Count the number of milliseconds between the two
click events on a paragraph
Coding Phase: Pseudo Code / Flow Chart / Algorithm
1. <!DOCTYPE html>: Specifies the document type and version of HTML being used.
2. <html lang="en">: Defines the root element of the HTML document with the language attribute
set to English.
3. <head>: Contains meta tags for character set and viewport settings, as well as the title of the
document.
4. <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>: Imports the jQuery library
from a CDN (Content Delivery Network).
5. <body>: Contains the content of the document.
6. <p id="clickInfo">Clicks: 0</p>: Displays the initial click count with an id attribute for JavaScript
manipulation.
7. <script>: Contains JavaScript code for handling click events and calculating time differences.
Testing Phase: Compilation of Code (error detection)
Click.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Click Event Timer</title>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
</head>
<body>
<p id="clickInfo">Clicks: 0</p>
<script>
var clickCount = 0;
var prevClickTime = 0;
$('p').on('click', function() {
var currentTime = new Date().getTime();
if (prevClickTime !== 0) {
var timeDifference = currentTime - prevClickTime;
alert('Milliseconds between clicks: ' + timeDifference);
}
prevClickTime = currentTime;
clickCount++;
$('#clickInfo').text('Clicks: ' + clickCount);
});
</script>
</body>
</html>
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : Create an simple application using AJAX to show the table of numbers
given by user at runtime.
Coding Phase: Pseudo Code / Flow Chart / Algorithm
1. The user interacts with the application by entering numbers into an input field and clicking the
"Generate Table" button.
2. Upon clicking the button, a JavaScript function is triggered, which retrieves the entered numbers
from the input field.
3. The JavaScript function then sends an AJAX POST request to the server-side PHP script, passing
the entered numbers as data.
4. On the server side, the PHP script receives the AJAX request and extracts the numbers data sent
from the client.
5. The PHP script calculates the square and cube of each number in the received data, generating
HTML code for table rows that include the original number, its square, and its cube.
6. After processing the data and generating the HTML code, the PHP script sends back the HTML
code for the table rows as the response to the AJAX request.
7. Back on the client side, the JavaScript function's success callback is triggered upon receiving the
response from the server.
8. The success callback updates the content of the table on the webpage with the HTML code for the
table rows received from the server, effectively displaying the table of numbers, squares, and
cubes entered by the user.
Testing Phase: Compilation of Code (error detection)
Table.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic Number Table</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<h2>Enter Numbers:</h2>
<input type="text" id="numbersInput">
<button onclick="fetchNumbers()">Generate Table</button>
<div id="tableContainer">
<table id="numbersTable">
<thead>
<tr>
<th>Number</th>
<th>Square</th>
<th>Cube</th>
</tr>
</thead>
<tbody id="tableBody">
</tbody>
</table>
</div>
<script>
function fetchNumbers() {
const numbersInput = document.getElementById('numbersInput').value;
$.ajax({
url: 'generate_table.php', // URL to your server-side script
method: 'POST',
data: { numbers: numbersInput },
success: function(response) {
$('#tableBody').html(response);
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
}
});
}
</script>
</body>
</html>
Generate_table.php
<?php
if(isset($_POST['numbers'])) {
$numbers = $_POST['numbers'];
$numbersArray = explode(',', $numbers);
$tableHTML = '';
foreach($numbersArray as $number) {
$number = trim($number);
if(is_numeric($number)) {
$square = $number * $number;
$cube = $number * $number * $number;
$tableHTML .= '<tr>';
$tableHTML .= '<td>'.$number.'</td>';
$tableHTML .= '<td>'.$square.'</td>';
$tableHTML .= '<td>'.$cube.'</td>';
$tableHTML .= '</tr>';
}
}
echo $tableHTML;
} else {
echo 'Error: Numbers data not received.';
}
?>
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : Develop student registration web appication using PHP
Coding Phase: Pseudo Code / Flow Chart / Algorithm
1. Database Setup:
•
Create a MySQL database named "student_registration" with a "students"
table.
2. HTML Form (index.html):
•
Create a form for student registration with fields like name, email, phone,
address, etc., using the POST method.
3. PHP Script (register_student.php):
•
Retrieve and sanitize form data.
•
Insert the data into the "students" table in the database.
•
Display success or error message.
4. Display Students (view_students.php):
•
Fetch and display all student records from the "students" table.
Testing Phase: Compilation of Code (error detection)
<?php
include 'db_connect.php';
// Add Student
if(isset($_POST['add_student'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$sql = "INSERT INTO students (name, email, phone) VALUES ('$name', '$email', '$phone')";
if ($conn->query($sql) === TRUE) {
header("Location: index.php");
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
// Fetch Students
$sql = "SELECT * FROM students";
$result = $conn->query($sql);
?>
<!DOCTYPE html>
<html>
<head>
<title>Student Registration</title>
</head>
<body>
<h2>Student Registration</h2>
<form method="post" action="">
<input type="text" name="name" placeholder="Name" required><br><br>
<input type="email" name="email" placeholder="Email" required><br><br>
<input type="text" name="phone" placeholder="Phone" required><br><br>
<input type="submit" name="add_student" value="Add Student">
</form>
<br>
<h2>Registered Students</h2>
<table border="1">
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Action</th>
</tr>
<?php
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>".$row['name']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['phone']."</td>";
echo "<td><a href='edit.php?id=".$row['id']."'>Edit</a> | <a
href='delete.php?id=".$row['id']."'>Delete</a></td>";
echo "</tr>";
}
} else {
echo "<tr><td colspan='4'>No records found</td></tr>";
}
?>
</table>
</body>
</html>
<?php
$conn->close();
?>
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : Create a PHP application with an HTML form for users to submit
comments, a PHP script to add comments to a database, and another PHP script to display all
submitted comments.
Coding Phase: Pseudo Code / Flow Chart / Algorithm
1. Database Setup:
•
Create a MySQL database with a table for student records.
2. HTML Form:
•
Design an HTML form for student registration with fields like name, email,
phone, address, etc.
3. PHP Script (Register):
•
Retrieve and sanitize form data in a PHP script.
•
Connect to the database and insert student information into the table.
4. PHP Script (Display):
•
Create a PHP script to fetch and display all registered students from the
database.
5. Security Measures:
•
Use prepared statements or parameterized queries to prevent SQL injection.
•
Validate and sanitize user inputs to ensure data integrity and security.
Testing Phase: Compilation of Code (error detection)
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Comment Form</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Add Comment</h1>
<form action="process_comment.php" method="POST" id="myform">
<label class="ele" for="name">Name:</label><br>
<input class="ele" type="text" id="name" name="name" required><br>
<label class="ele" ="comment">Comment:</label><br>
<textarea class="ele" id="comment" name="comment" rows="4" cols="50" required></textarea><br>
<input class="ele" type="submit" value="Submit">
</form>
<a href="display_comment.php"><button id="dc">See Comments</button></a>
</body>
</html>
process_comment.php
<?php
$host = 'localhost';
$username = 'root';
$password = 'Srpan@070223';
$database = 'comments';
$conn = new mysqli($host, $username, $password, $database);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$name = $_POST['name'];
$comment = $_POST['comment'];
$sql = "INSERT INTO comments (name, comment) VALUES ('$name', '$comment')";
if ($conn->query($sql) === TRUE) {
echo "Comment added successfully!";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
Display_comment.php
<?php
$host = 'localhost';
$username = 'root';
$password = 'Srpan@070223';
$database = 'comments';
$conn = new mysqli($host, $username, $password, $database);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM comments";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "Name: " . $row['name'] . "<br>";
echo "Comment: " . $row['comment'] . "<br><br>";
}
} else {
echo "No comments yet.";
}
// Close connection
$conn->close();
?>
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
School: School of Engineering and technology
Campus: Paralakhemundi
Academic Year: 2021-25
Subject Name:ADVANCED WEB PROGRAMMING
Subject Code: CUTM1030
Semester: 6th
Branch: CSE
Specialization: CSE
Program: B.Tech
Date:
Applied and Action Learning
(Learning By doing and discovery)
Name of the Experiment : Create a XML document and also apply DTD to it.
Coding Phase: Pseudo Code / Flow Chart / Algorithm
1. Parse the XML document Library.xml.
2. Check for the correct XML declaration and DTD reference.
3. Extract data for each <book> element: id, title, author, genre, price.
4. Store the extracted data using Library.dtd file
5. Optionally validate or process the data further.
Testing Phase: Compilation of Code (error detection)
Library.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library SYSTEM "library.dtd">
<library>
<book id="1">
<title>XML for Beginners</title>
<author>John Doe</author>
<genre>Programming</genre>
<price>29.99</price>
</book>
<book id="2">
<title>HTML Basics</title>
<author>Jane Smith</author>
<genre>Web Development</genre>
<price>19.99</price>
</book>
</library>
Library.dtd
<!DOCTYPE library [
<!ELEMENT library (book*)>
<!ELEMENT book (title, author, genre, price)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT genre (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ATTLIST book id ID #REQUIRED>
]>
Implementation Phase: Final Output (no error)
Assessment
Rubrics
Concept
10
Planning and Execution/
10
Practical Simulation/ Programming
Result and Interpretation
10
Record of Applied and Action Learning
10
Viva
10
Total
50
Signature of the Student:
Signature of the Faculty:
Download