php imp
php imp
3. Discuss the role of file permissions in PHP. Write a script to check if a file is readable,
writable, and executable. (5)
4. Write a PHP script to create an associative array of five fruits and their prices. Use a loop
to display each fruit and its price in a tabular format. (5)
5. Write a PHP script to handle a form that takes a user’s name and email as input. Validate
the input to ensure:
6. Explain the process of database connectivity in PHP. Write a PHP script to connect to a
MySQL database and perform the following:
(a) Insert a new record into a students table with fields (ID, Name, Age, Email).
(b) Retrieve and display all records from the students table in an HTML table format. (10)
7. Write a PHP script to perform file upload functionality. The script should ensure that:
8. Define and explain arrays in PHP. Write a script to create a multi-dimensional array for
storing product details (Product ID, Name, Price, Quantity). Display the array in a tabular
format. Also, calculate the total value of each product (Price × Quantity) and display it in the
table. (10)