JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech IV Year PHP PROGRAMMING Previous Question Paper (September - 2020 - R16)
Answer any Five Questions. All Questions Carry Equal Marks.
Main
Is PHP a server side language or client side language? Explain your answer.
Answer
PHP is a server-side scripting language. This means that PHP code is executed on the web server rather than in the user's web browser.
When a client requests a PHP file, the server processes the script, performs necessary operations such as database interactions or calculations, and generates HTML output. This resulting HTML is then sent to the client's browser, which only receives the final rendered output and has no access to the original PHP source code. This architecture enhances security and allows for dynamic content generation based on server-side data.
Write a function to swap two integers variables A & B without using any extra variable using PHP script.
Answer
To swap two integer variables without using a third temporary variable, arithmetic operators such as addition and subtraction can be used. The following PHP script demonstrates this logic:
<?php
$a = 10;
$b = 20;
echo "Before swapping: A = $a, B = $b <br>";
$a = $a + $b;
$b = $a - $b;
$a = $a - $b;
echo "After swapping: A = $a, B = $b";
?>The logic works by storing the sum of both numbers in the first variable, then subtracting the original value of the second variable from the sum to isolate the first value, and finally subtracting the new value of the second variable from the sum to isolate the second value.
Explain about all conditional statements with suitable examples.
Answer
Sign in to view the complete answer paper.
How to integrate a HTML web page with PHP?
Answer
Sign in to view the complete answer paper.
Illustrate parameterized and non-parameterized functions in PHP.
Answer
Sign in to view the complete answer paper.
Write a PHP program for recursive functions.
Answer
Sign in to view the complete answer paper.
Explain the scope of different variables in PHP with suitable example.
Answer
Sign in to view the complete answer paper.
Differentiate between system defined functions and user defined functions.
Answer
Sign in to view the complete answer paper.
Write a PHP script to read a file and copy the content into a new file.
Answer
Sign in to view the complete answer paper.
Write PHP program for creating and deleting a folder.
Answer
Sign in to view the complete answer paper.
What are FORMS? Explain different Form fields.
Answer
Sign in to view the complete answer paper.
How to pass variables to multiple forms? Explain with suitable PHP script.
Answer
Sign in to view the complete answer paper.
Write a PHP script to create an Image table and upload image into the table.
Answer
Sign in to view the complete answer paper.
How to integrate PHP with MySQL server? Write a program using PHP to join two tables and retrieve the data.
Answer
Sign in to view the complete answer paper.