Tutorial 14 PHP oop and Ajax with Jquery

  1. Create a class called "Student" that inherits from "Person" and has an additional property "major". Override the "greet" method to return "Hello, my name is [name], I am [age] years old and I am majoring in [major]."
  2. Create a method in the Person class called setAge that accepts  a new age as an argument and updates the age property. Create a similar method in the Student class called setStudentId that accepts a new student ID as an argument and updates the studentId property, and in the Teacher class called setTeacherId that accepts a new teacher ID as an argument and updates the teacherId property and finally print all.
  3. Demonstrate the use of load, get and Post methods of ajax using jquery.
  4. Write a PHP script with jQuery using ajax method to show the number of years in the selection box based on the selection of courses in the selection box above.
  1. You will require 2 tables in database
  2. Course and year tables given below.
  3. Output of the question also given below.

 

********************************************************************************