You are on page 1of 3

Department of Computer Sceince, GUNI.

U15A2BWD Basic Web Programming & Designing

Practical List

1. Write PHP script to display your name, address on the screen in different line and also
display PHP version and configuration information.
2. Write PHP script to convert dollar to rupees and rupees to dollar using switch
statement. (Display user menu for conversion operations). Create separate user
defined functions for each conversion operation. Accept currency (dollar or rupees)
from users.
3. Design a chessboard in PHP.
4. Perform following operations on string.
1) Convert the integer variable into string and check whether the value and
variable types are same or not. ( Use of == and === operator and string())
2) Write a PHP script to extract and display different components of any URL.
Input: www.example.com/admin/index.php
Output: www.example.com, admin, index.php
3) Remove all leading zeroes from a string
Input: 000647023.34
Output: 647023.34
4) Write a php script that print different characters from two string.
Input: 1) foot
2) feet
Output: ooee
5. Create an associative array in PHP to store employee name and salary of the
employee as key-value pair. Perform the following operations on it:

 Display the name of employees in ascending order.


 Display the employee names and their salaries in descending order of salaries.
 Unset the salary of the employee named as “Dhaval”.
 Display name and salary of employee who has lowest salary.
6. Perform following date operations:
1) Display current date and time.
2) Display the difference between current date and user provided date.
7. Develop a web page to enter your Enrolment No, Name, Address, City (prepare drop
down list) and Gender. Validate the entries at client side:
 All the information should not be blank.
 Enrolment No must be numbers only and must be of 10 digits only with range
between 18082221001 to 18082221025.
 Name and City must be characters only.

If the information is valid then display Enrolment No, Name, Address, City and
Gender of the student on the next page in tabular format.

8. Create a login page with remember me option. If user select on remember me check
box then login credentials should be stored in cookie and should be retrieved when
user send the request again from the same machine. Auto fills username and password
textboxes using cookie. Also validate the user credentials from database (login table).
9. Create a user registration page having fields like rid, uid, password, confirmpassword,
name, address, city, pincode, birthdate, mobileno. Perform the following operations
on it using PHP script.
 Create a table called registration_master in MySQL database having all the
fields mentioned above. (Except confirmpassword). rid should be primary key,
uid should be unique key, birthdate should be of date type.
 Password must be of minimum 8 characters long. Password and confirm
password must be same.
 City names should be fetched from city table and should be added in city drop
down list when the page loads.
 Insert at least 10 records in the registration_master table.
 View: Record must be displayed in proper table format and immediately
reflected in view section as user keeps inserting records. Display birthdate in
dd/mm/yyyy format. Calculate and display the age of the user also.
 Delete the record of the student when user clicks on delete button of that
record.
 Update the record when user clicks on update button of that record. New form
will be displayed while updating your record and old data should be displayed
in form. The id should be only readable and user should allow updating rest
form field. When user clicks on save button, the record will be updated in
database and user should be redirected to view page of records.
10. Create one search facility page which search the records by name or city from
registration_master table and display the records in tabular format.

11. Create product_master table having fields like pid, pname, qty, rate, image1, image2,
image3. Perform the following operations on it using PHP script.
 Insert 5 product details on the table.
 Upload product images on the server. The uploaded product image must be of
.jpg or .png format only and must not be greater than 1 MB in size.
 Store image path (Relative Path) in image field in the product_master table.
 Display all the products information along with their images in tabular format.

12. Create tables like country (cntid PK, cntname), state (sid PK, sname, cntid FK), city
(cid PK, cname, sid FK), student_master (stid, stname, cid FK) in MySQL. Perform
following operations on it using PHP script.
 Insert 5 records in each table.
 Display all the student records with following information:
sid, studentname, cityname, statename, countryname.

13. Read the employee data like empid, empname, empdept, empcity, empmobno records
from employee.csv file and upload them in employee_master table using PHP script.

You might also like