JNTU
JNTU MCA 2022 WEB TECHNOLOGIES Previous Question Paper (September/October - 2022 - R20)
Answer any five questions. All questions carry equal marks.
Main
Explain the control structures in PHP?
Answer
PHP control structures allow for flow control within a script, categorized into selection, iteration, and jump statements:
- Selection Statements: These include if, elseif, and else for conditional execution, and the switch statement, which compares a single variable against multiple values.
- Iteration Statements: These are used for looping through code blocks. while and do-while loops execute as long as a condition is true. The for loop is used when the number of iterations is known, and the foreach loop is specifically designed for iterating over arrays and objects.
- Jump Statements: These alter the execution flow. break terminates the current loop or switch, continue skips the remainder of the current loop iteration, and return exits a function or script.
Write a PHP script to check the user credentials, whether they are correct are not. If the credentials are correct then the user will be redirected to another page.
Answer
The following script demonstrates a basic credential check using hardcoded values and the header() function for redirection:
<?php
$username = "admin";
$password = "password123";
if ($_POST['user'] == $username && $_POST['pass'] == $password) {
header("Location: dashboard.php");
exit();
} else {
echo "Invalid credentials. Please try again.";
}
?>In this script, the header() function sends a raw HTTP header to the browser to redirect the user to dashboard.php upon successful verification. The exit() function is essential to ensure no further code is executed after the redirection header is sent.
Explain the following file operations in PHP with example:
a. opening
b. reading
c. appending.
Answer
Sign in to view the complete answer paper.
Explain the purpose of cascading style sheets.
Answer
Sign in to view the complete answer paper.
Design and create the HTML page(s) for accepting the values of name and marks in a table then display them in the ascending order of the marks.
Answer
Sign in to view the complete answer paper.
Explain the features of XML.
Answer
Sign in to view the complete answer paper.
What is a Document Type Definition (DTD)? How do you create DTD?
Answer
Sign in to view the complete answer paper.
Explain the characteristics of Common Gateway Interface (CGI).
Answer
Sign in to view the complete answer paper.
Describe the life cycle of a Servlet.
Answer
Sign in to view the complete answer paper.
Explain with suitable example, how servlet handle HTTP get requests and HTTP post requests.
Answer
Sign in to view the complete answer paper.
Briefly describe the processing of a JSP application.
Answer
Sign in to view the complete answer paper.
What are implicit objects available to JSP page? Explain.
Answer
Sign in to view the complete answer paper.
Explain event handlers in java script.
Answer
Sign in to view the complete answer paper.
Write short note on Document Object Model(DOM).
Answer
Sign in to view the complete answer paper.