JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III WEB TECHNOLOGIES Previous Question Paper (January/February - 2021 - R16)
Answer any five questions
All questions carry equal marks
Main
Create a PHP form to accept user id and password with necessary validations.
Answer
To create a secure PHP form for user authentication, we define an HTML form that submits data to a PHP script using the POST method. The PHP script then performs server-side validation to ensure the fields are not empty and meet security requirements.
The following HTML structure creates the input fields:
<form method="post" action="login.php">
User ID: <input type="text" name="userid" required><br>
Password: <input type="password" name="password" required><br>
<input type="submit" value="Login">
</form>The server-side PHP validation script processes the input:
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$userid = trim($_POST['userid']);
$password = $_POST['password'];
if (empty($userid) || empty($password)) {
echo "User ID and Password are required.";
} elseif (strlen($password) < 8) {
echo "Password must be at least 8 characters long.";
} else {
// Sanitize input to prevent XSS
$userid = htmlspecialchars($userid);
echo "Validation successful for user: " . $userid;
}
}
?>Key validation steps include:
- Empty Check: Using empty() to ensure fields are not submitted blank.
- Sanitization: Applying htmlspecialchars() to prevent Cross-Site Scripting (XSS) attacks.
- Input Trimming: Using trim() to remove unnecessary whitespace from the User ID.
- Length Validation: Ensuring the password meets minimum complexity requirements before processing.
Design a layout using XML containing an application form.
Answer
An XML layout for an application form organizes data hierarchically using descriptive tags. The structure includes root elements for the form and nested elements for personal details and submission information.
<applicationForm>
<applicant>
<name>John Doe</name>
<email>[email protected]</email>
<phone>123-456-7890</phone>
</applicant>
<education>
<degree>B.Tech</degree>
<yearOfPassing>2024</yearOfPassing>
</education>
<submissionDate>2023-10-27</submissionDate>
</applicationForm>Explain the XML schema languages in detail.
Answer
Sign in to view the complete answer paper.
Elaborate the Common Gateway Interface and its important.
Answer
Sign in to view the complete answer paper.
Give a brief note on Servlet.
Answer
Sign in to view the complete answer paper.
Design the JSP application with MVC set up and explain the process and various entities in it.
Answer
Sign in to view the complete answer paper.
Write a short note on Event handlers in JavaScript.
Answer
Sign in to view the complete answer paper.
Give a brief note on the AJAX application.
Answer
Sign in to view the complete answer paper.
List and explain the different operators and control structures in PHP with an example.
Answer
Sign in to view the complete answer paper.
What is an XML DOM? How DOM parses the XML file?
Answer
Sign in to view the complete answer paper.
Write a brief note on document type definition.
Answer
Sign in to view the complete answer paper.
Draw and explain the Lifecycle of a Servlet.
Answer
Sign in to view the complete answer paper.