JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech IV Year PHP PROGRAMMING Previous Question Paper (December - 2020 - R16)
Answer any Five Questions. All Questions Carry Equal Marks.
Main
Explain the features and advantages of Apache Web Server.
Answer
The Apache HTTP Server is an open-source, cross-platform web server software that plays a fundamental role in the LAMP (Linux, Apache, MySQL, PHP) stack. It is highly regarded for its stability, security, and flexibility in serving web content.
Key Features:
- Modular Architecture: Apache uses a modular design, allowing administrators to load or unload functionality (such as SSL/TLS, URL rewriting, or authentication) dynamically using modules without recompiling the core server.
- Cross-Platform Support: It runs seamlessly on various operating systems, including Linux, Unix, Windows, and macOS.
- Virtual Hosting: Apache supports both IP-based and name-based virtual hosting, enabling a single server instance to host multiple websites or domains simultaneously.
- Configuration via .htaccess: It allows directory-level configuration using
.htaccessfiles, providing granular control over server settings for specific directories without requiring access to the main server configuration file. - Robust Security: It includes built-in features for user authentication, access control, and SSL/TLS encryption, making it suitable for secure web applications.
- Scalability: Through Multi-Processing Modules (MPMs), Apache can be tuned for different traffic patterns, utilizing either process-based or thread-based request handling.
Advantages:
- Open Source and Free: Being free to use and distribute, it is highly cost-effective for both small projects and large-scale enterprise deployments.
- Community Support: Due to its long history and widespread adoption, there is extensive documentation, active community forums, and a vast library of third-party modules available.
- Compatibility: It is highly compatible with PHP, making it the standard choice for executing PHP-based web applications.
- Reliability: Apache is battle-tested and known for its ability to handle high traffic loads reliably, maintaining uptime even under complex configurations.
- Customizability: The ability to tailor the server behavior to specific application needs via its configuration directives makes it highly versatile for developers.
Demonstrate all the looping statements in PHP with suitable examples.
Answer
PHP provides four primary looping structures used to execute a block of code repeatedly based on specific conditions. These are the while, do-while, for, and foreach loops.
- while loop: Executes a block of code as long as the specified condition is true. The condition is checked before the loop body executes.$i = 1; while($i <= 5) { echo $i; $i++; }
- do-while loop: Similar to the while loop, but it guarantees that the code block executes at least once because the condition is evaluated after the loop body.$i = 1; do { echo $i; $i++; } while($i <= 5);
- for loop: Used when the number of iterations is known in advance. It combines initialization, condition, and increment/decrement in a single line.for($i = 1; $i <= 5; $i++) { echo $i; }
- foreach loop: Specifically designed to iterate over arrays or objects. It is the most efficient way to access every element in an array.$colors = array('Red', 'Green', 'Blue'); foreach($colors as $value) { echo $value; }
Explain about Dynamic parameters in PHP functions.
Answer
Sign in to view the complete answer paper.
Differentiate between call by value and call by reference in PHP.
Answer
Sign in to view the complete answer paper.
How to search a specific word in PHP file and replace with a new word.
Answer
Sign in to view the complete answer paper.
Write a PHP script which takes the username, password and e-mail values from as input from user and checks whether the user has filled the textboxes or not. Also, check the e-mail field whether it is valid or not.
Answer
Sign in to view the complete answer paper.
Explain about session Http management with suitable example.
Answer
Sign in to view the complete answer paper.
How to destroy cookies and sessions in PHP? Explain in detail.
Answer
Sign in to view the complete answer paper.
How to create a table in MySQL? Explain the process of connecting PHP with MySQL?
Answer
Sign in to view the complete answer paper.