PHP 1
PHP 1
(COMPUTER SCIENCE)
KATHMANDU, NEPAL
2024
Table of Contents
1. Acknowledgement I
2. Objectives II
3. Theoretical Background
3.1.1 PHP
4. Work Done
1. WAP to find sum of two numbers. Here, numbers are entered via html form.
3. Write a PHP program to input name and address using form and display them.
4. Write a PHP program to find the greatest number among three numbers. Here,
numbers are entered via html form.
5. Write a PHP program to input any number via form and check whether the number
is positive or negative and be sure number should not be zero.
7. Write a PHP program to print a multiplication table of a number. Input the number
via form.
10. Write a PHP program to store some strings in an array and print them.
11. Write a PHP program to sort data stored in an array. [Use sort() function and
print_r() to print.]
12. Write a PHP program to know whether two strings are the same or not.
13. Write a PHP program to input a string through a text box and find its length.[use
strlen()]
15. Write a PHP program to insert records in a database named student having table
student with field’s id, name and grade.
16. Write a PHP program to display all records (previous question) of students who
are in grade 11.
18. Write a PHP program to update a record of student whose id is 2. [Try same
program with name/grade.
5. Conclusion
CONCLUSION
As you explore PHP, it’s essential to practice writing code and testing it to become
proficient. It’s also important to integrate PHP with databases like MySQL to create
dynamic, data-driven websites. PHP's versatility, ease of integration with HTML, and
vast community support make it a valuable tool for aspiring web developers.
Understanding these concepts can open doors to more advanced topics in web
development and programming.
OBJECTIVE
To understand basic syntax of PHP
To understand variable, data types and comment in PHP
To understand Operators, conditional statements and iteration in PHP.
To understand and apply the concept of loop/iteration in PHP.
To understand the concept of array and its elements.
To understand and apply some PHP built-in functions.
To understand Form Processing.
To accessing MySQL using PHP
To perform CRUD Operation