JNTU
JNTU B.Tech IV Year PHP PROGRAMMING Previous Question Paper (June - 2024 - R16)
Note: i) Question paper consists of Part A, Part B.
ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions.
iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.
Part A
Define PHP.
Answer
PHP stands for PHP: Hypertext Preprocessor. It is a widely-used, open-source server-side scripting language specifically designed for web development that can be embedded directly into HTML code.
Explain the purpose of PHP tags in a web page.
Answer
PHP tags act as delimiters that signal to the web server that the enclosed code should be processed by the PHP engine rather than being sent directly to the browser as plain text. The standard tags are
State the purpose of the rand() function in PHP.
Answer
Sign in to view the complete answer paper.
Explain the difference between local and global scope in PHP variables.
Answer
Sign in to view the complete answer paper.
State two examples of HTML form elements.
Answer
Sign in to view the complete answer paper.
Explain the role of the action attribute in an HTML form. How does it affect form submission?
Answer
Sign in to view the complete answer paper.
List and briefly explain three types of errors in PHP.
Answer
Sign in to view the complete answer paper.
Define what exceptions are in PHP. How are they different from regular errors?
Answer
Sign in to view the complete answer paper.
State two commonly used MySQL commands.
Answer
Sign in to view the complete answer paper.
Explain the syntax of a basic MySQL query. What are the components of a SELECT statement?
Answer
Sign in to view the complete answer paper.
Part B
Create a PHP script that calculates the sum of two numbers entered by the user.
Answer
Sign in to view the complete answer paper.
Implement a PHP script that reads data from a MySQL database and displays it in a formatted table.
Answer
Sign in to view the complete answer paper.
Develop a PHP program that checks if a given number is prime or not.
Answer
Sign in to view the complete answer paper.
Write a PHP function that counts the number of occurrences of a specific word in a given string.
Answer
Sign in to view the complete answer paper.
Create a user-defined PHP function that calculates the factorial of a given number. Demonstrate its usage with an example.
Answer
Sign in to view the complete answer paper.
Design a PHP script that checks if a given username already exists in a MySQL database. If not, insert the username into the database.
Answer
Sign in to view the complete answer paper.
Write a PHP program that takes user input (name and age) from a form and displays a personalized greeting based on the age provided.
Answer
Sign in to view the complete answer paper.
Analyze the importance of data validation in form processing. How does it contribute to the security and integrity of web applications?
Answer
Sign in to view the complete answer paper.
Evaluate the impact of file handling errors on the reliability of web applications. How can such errors be minimized through error handling techniques in PHP?
Answer
Sign in to view the complete answer paper.
Explain how to create and delete folder with an example.
Answer
Sign in to view the complete answer paper.
Describe about the validating the user input.
Answer
Sign in to view the complete answer paper.
Create a PHP script that generates an image table dynamically based on user input.
Answer
Sign in to view the complete answer paper.
Examine the significance of proper syntax in PHP scripts to avoid parse errors. How can developers ensure syntactic correctness?
Answer
Sign in to view the complete answer paper.
Describe how emails can be sent using PHP. What functions are commonly used for this purpose?
Answer
Sign in to view the complete answer paper.
Develop a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits.
Answer
Sign in to view the complete answer paper.
Create a MySQL query that retrieves all records from a table named “users”. Provide a brief explanation of each component of the query.
Answer
Sign in to view the complete answer paper.
Create a MySQL query that deletes records from a table based on specified conditions, such as a certain value in a particular column. Provide an example scenario.
Answer
Sign in to view the complete answer paper.
Design a MySQL query that joins two tables, “orders” and “customers”, based on a common field such as customer ID. Provide an explanation of the join type used.
Answer
Sign in to view the complete answer paper.
Design a MySQL query that alters the structure of a table by adding a new column. Include the necessary syntax for the alteration.
Answer
Sign in to view the complete answer paper.