0% found this document useful (0 votes)
2 views

10..Assignment.php

PHP (Hypertext Preprocessor) is a server-side scripting language used for web development to create dynamic web pages and manage databases. Key features include server-side execution, database integration, and cross-platform compatibility. PHP differs from client-side languages like JavaScript by executing on the server and directly interacting with databases, while also generating dynamic HTML before sending it to the browser.

Uploaded by

mohamedliban972
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

10..Assignment.php

PHP (Hypertext Preprocessor) is a server-side scripting language used for web development to create dynamic web pages and manage databases. Key features include server-side execution, database integration, and cross-platform compatibility. PHP differs from client-side languages like JavaScript by executing on the server and directly interacting with databases, while also generating dynamic HTML before sending it to the browser.

Uploaded by

mohamedliban972
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

PHP

Assignment :
1. What is PHP, and why is it used?
PHP (Hypertext Preprocessor) is a server-side scripting language designed for web
development. It is used to create dynamic web pages, manage databases, handle form
submissions, and build web applications.
2. Describe three key features of PHP.
o Server-side execution: PHP code runs on the server,
generating HTML sent to the client.
o Database integration: PHP supports multiple databases like
MySQL, PostgreSQL, and SQLite.
o Cross-platform compatibility: PHP runs on various
operating systems, including Windows, macOS, and Linux.
3. How does PHP differ from client-side scripting languages like JavaScript?
o PHP executes on the server, whereas JavaScript runs in the
user's browser.
o PHP can interact directly with databases, while JavaScript
requires AJAX or other technologies to do so.
o PHP generates dynamic HTML before the page is sent to the
browser, while JavaScript manipulates the page after it loads.
4. What are some popular databases that PHP supports?
PHP supports MySQL, PostgreSQL, SQLite, Oracle, Microsoft SQL Server, and
MariaDB.
5. Explain how PHP handles form data.
PHP collects form data using $_GET and $_POST superglobal arrays. Example:
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = $_POST['name'];
echo "Hello, " . htmlspecialchars($name);
}
?>
6. What does PHP stand for?
PHP originally stood for "Personal Home Page" but now stands for "PHP: Hypertext
Preprocessor" (a recursive acronym).
7. Which type of language is PHP?
PHP is a server-side scripting language primarily used for web development.
8. Create a new PHP file (test.php) and write a script that displays "Hello, PHP!".
<?php
echo "Hello, PHP!";
?>
9. What is the default file extension for PHP files?
The default file extension for PHP files is .php.
10. Which of the following is a characteristic of PHP?
PHP is open-source, server-side, interpreted, and supports embedding within
HTML.

You might also like