Swati Lathia

Learning ways

PHP Assignments

Assignment – 1

  1. Write a PHP script that displays your name entered by the user from the text box.
  2. Write a PHP script that performs arithmetic operations . Values must be entered by the user from the text box.
  3. Write a PHP script that uses while loop & do while loop. Starting & ending value of loop must be entered by user from text box.
  4. Write a PHP script that displays your name with the use of for loop.
  5. Write a PHP script that returns cube of a number given by user input using UDF.
  6. Write a PHP script that performs any 5 string functions.
  7. Write a PHP script that performs any 5 array functions.
  8. Write a PHP script that performs any 5 Math functions
  9. Write a PHP script that performs any 5 Date functions.
  10. Write a PHP script that displays current date(Date with suffix, Month name, Year, Day name) and the date before 1 year of the current date (Date with suffix, Month name, Year, Day name). For example: 5th January 2023, Thursday
  11. Write a PHP script that performs any 5 File handling functions.
  12. Write a PHP script that uploads any type of file by user input and move it to another folder
  13. Write a PHP script that fetches data of a specified student from database using AJAX
  14. Write a jQuery that uses load, change, blur, click, dblclick and resize event.
  15. Write a PHP script of Login page using Session.

Assignment – 2

  1. Write a PHP script that inserts records into tbl_bookinfo.
    Database : db_book
    Tablename : tbl_bookinfo
    Fields : book_id int primary key auto increment
    book_name varchar
    book_publication varchar
    book_price int
  2. Write a PHP script that displays all the records of tbl_bookinfo in tabular format
  3. Write a PHP script that deletes a record by bookid and then show rest of the records in tabular form
  4. Write a PHP script that updates a record by bookid and then show rest of the records in tabular form

Assignment – 3

  1. Create an HTML form and validate it : Student’ First Name, Last Name, Date of Birth, Address, Mobile Number, Email using regular expression
  2. Write a Script that creates a PHP cookie which stores user’s firstname, lastname, mobile number in it from the HTML form
  3. Write a Script that displays below Pie Chart which shows the popularity of different social media using GD library functions
  4. Write a Script that displays a table of given integer entered by the user in tabular form
Pie Chart

Assignment – 4

  1. Write a PHP script that creates a Class to demonstrate private and public properties.
  2. Write a PHP script that creates a Class to demonstrate Constructor and Destructor.
  3. Write a PHP script that creates a Class to demonstrate Inheritance with private and protected members.
  4. Write a PHP script that creates a Student Class to demonstrate methods.
Scroll to top