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

PHP Practice Questions

The document outlines an assignment for a PHP web development course. It includes 27 questions requiring students to write PHP programs that connect to databases, insert/update/delete records, generate and manipulate images, create PDF files, and work with XML files. The programs are asked to perform tasks like drawing shapes with colors, rotating images, adding headers/footers to PDFs, and retrieving/outputting data from XML files.

Uploaded by

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

PHP Practice Questions

The document outlines an assignment for a PHP web development course. It includes 27 questions requiring students to write PHP programs that connect to databases, insert/update/delete records, generate and manipulate images, create PDF files, and work with XML files. The programs are asked to perform tasks like drawing shapes with colors, rotating images, adding headers/footers to PDFs, and retrieving/outputting data from XML files.

Uploaded by

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

CAP777: WEB DEVELOPMENT USING PHP

DE704 Group-2C

Assignment
Submission Last Date: 20th April 2020

Solve all the Questions:

1) Create a database in MYSQL and name it as “buildings”. Create the following table
name it as “lpu_apartment” under “buildings” database and insert any 3 records.

apartment apartment total_plots warden_name warden_uid warden_pno


_id _name
41C Faculty 56 Jaryal 98786 98767656
apartments

Write a PHP program to insert new record into “lpu_apartment” table.

Write a PHP program to delete the record into “lpu_apartment” table

2) Create a database in MYSQL and name it as “CA_Department”. Create the following


table name it as “subject” under “CA_Department” database and insert any 3 records.

subject _id subject _name class_room class_time faculty_name faculty_uid


CAP902 PHP 38 605 9 Dr Santosh 24372

Write a PHP program to insert new record into “subject” table.

Write a PHP program to update any one of the record from “subject” table

3) Write a PHP program to create a database by giving the name as “globe”.

Write a PHP program to create the following table name it as “country” under “globe”
database.

country country _std language total_states president continent_name


_name _name
India

Write a PHP program to insert new record into “country” table.

4) Create a database in MYSQL and name it as “Graphics”. Create the following table name
it as “software” under “Graphics” database and insert any 3 records.

software_id software_name software_price valid_months origin_name total_users


1021 Matlab 65000 12 India 2

Write a PHP program to insert new record into “software” table.

Write a PHP program to update any one of the record from “software” table

5) Write a PHP program to draw the following objects with the suitable border
colours and fill it with co-related colours.

6) Write a PHP program to draw the following objects with the suitable border
colours and fill it with co-related colours

.
7) Write a PHP program to draw the following objects with the suitable border
colours and fill it with co-related colours.
8) Write a PHP program to draw the following objects with the suitable border
colours and fill it with co-related colours.

9) Write a PHP program to draw the following objects with the suitable border
colours and fill it with co-related colours.

10) Write a PHP program to draw the following objects with the suitable border
colours and fill it with co-related colours.

11) Write a PHP program to draw the following objects with the suitable border
colours and fill it with co-related colours and modify an image as shown below.
12) Write a PHP program to draw the following objects with the suitable border
colours and fill it with co-related colours and Get a portion of the image

13) Write a PHP program to draw a right triangle, this generates the image in Figure

14) Write a PHP Program to create a pdf file and insert the footer with suitable text
and to print the text on top and bottom of the page.
15) Write a PHP program to draw the Rectangle and fill it with Blue Color. To draw
any four different shapes of Aarcs inside the Rectangle box and save it as
“new.png”.
16) Write a PHP program to rotate the above created image with height*0.9 and
width*0.9
17) Write a PHP Program to create a pdf file and insert the Header with suitable text
in single page and to print the text on top and bottom of the page.

18) Write a PHP Program to create a pdf file and insert the hyperlink of
http://www.yahoo.com to navigate to second page with suitable text in first page.
To insert the hyperlink http://www.gmail.com to navigate to second page with
suitable text in gmail web-page
19) Write a PHP Program to create a pdf file and to insert page numbers (like as
page: 1 / total pages: 2) and logo in every page in header / footer.
20) Write a PHP Program to a create a pdf file and to print the message of “CAP777-
PHP Assignment” at text top-left, top-right, middle, bottom-left and bottom-right
of the page.
21) Write a PHP Program to create a pdf file and print the text “Hi, Good Morning”
with various text type: arial and formatting styles such as italic, underline and
bold.
22) Write a PHP Program to create a pdf file and insert the Header with suitable text
in single page. To print the text on top and bottom of the page.
23) Write a PHP Program to create a pdf file and insert the Footer with suitable text.
To print the text on top and bottom of the page.
24) Write xml program to create student-results XML file by student id, name, phone
number, subject1 marks, subject2 marks, subject3 marks, subject4 marks and
Results.
Write a PHP program to retrieve the student-results details from student-results
XML file
25) To Create an XML document using PHP with help of any example such as
employee or customer database
26) Write a PHP program to convert an XML string into an object, then output keys
and elements of the object with help of PHP simplexml_load_string() Function
27) Write xml program to create the following employee xml file.
Write a PHP program to retrieve the employee details from employee XML file

You might also like