-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update WEB lab assignments and fix bugs
- Loading branch information
Showing
7 changed files
with
50 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,35 @@ | ||
# Lab Assignment – IV (PHP) | ||
|
||
1. Write a simple PHP script that prints "Hello, PHP!" to the browser. | ||
2. Declare variables of different data types (integer, float, string) and demonstrate the usage of constants in PHP. | ||
3. Create a PHP program that uses if-else statements to check if a number is positive, negative, or zero. Utilize different operators for comparison. | ||
4. Develop a function that calculates the average of an array of numbers. Test the function with various arrays. | ||
5. Define a PHP class representing a "Book" with properties like title and author. Create objects of this class and display their attributes. | ||
6. Design a simple HTML form with input fields. Create a PHP script that retrieves and displays the form data when submitted. | ||
7. Enhance the previous form with PHP validation. Ensure that required fields are filled, and validate email addresses and make sure the phone number starts with 98 or 97 using regex | ||
8. Implement PHP code that responds to a button click event on a form. Display a message when the button is clicked. | ||
9. Create a PHP script that sets a cookie with user preferences.Retrieve and display this information on subsequent visits. | ||
10. Build a form with various elements (textboxes, checkboxes, radio buttons). Use PHP to access and display the selected values. | ||
11. Develop a PHP script that reads content from a text file, modifies it, and then writes the updated content back to the file. | ||
1. Write a simple PHP script that prints "Hello, PHP!" to the browser • [Code](1_hello_php.php) | ||
|
||
2. Declare variables of different data types (integer, float, string) and demonstrate the usage of constants in PHP • [Code](2_variables.php) | ||
|
||
3. Create a PHP program that uses if-else statements to check if a number is positive, negative, or zero. Utilize different operators for comparison • [Code](3_if-else.php) | ||
|
||
4. Develop a function that calculates the average of an array of numbers. Test the function with various arrays • [Code](4_function.php) | ||
|
||
5. Define a PHP class representing a "Book" with properties like title and author. Create objects of this class and display their attributes. • [Code](5_class.php) | ||
|
||
6. Design a simple HTML form with input fields. Create a PHP script that retrieves and displays the form data when submitted. • [Code](6_form_retrieval.php) | ||
|
||
7. Enhance the previous form with PHP validation. Ensure that required fields are filled, and validate email addresses and make sure the phone number starts with 98 or 97 using regex • [Code](7_enhancement_of_6.php) | ||
|
||
8. Implement PHP code that responds to a button click event on a form. Display a message when the button is clicked • [Code](8_button_click.php) | ||
|
||
9. Create a PHP script that sets a cookie with user preferences.Retrieve and display this information on subsequent visits • [Code](9_cookies.php) | ||
|
||
10. Build a form with various elements (textboxes, checkboxes, radio buttons). Use PHP to access and display the selected values • [Code](10_form.php) | ||
|
||
11. Develop a PHP script that reads content from a text file, modifies it, and then writes the updated content back to the file • [Code](11_file.php) | ||
|
||
## Lab 4.1 Connecting to database | ||
|
||
1. Write PHP code to establish a connection to a MySQL database, including the necessary credentials. | ||
2. Develop a PHP script to insert a new record into a MySQL database table.Ensure proper validation and sanitation of input data. | ||
3. Create a PHP script that retrieves and displays all records from a MySQL database table. | ||
4. Modify a specific record in a MySQL table using PHP. Ensure that the update is based on user input or specific criteria. | ||
5. Implement PHP code to delete a record from a MySQL table. Provide options for the user to select the record to be delete | ||
1. Write PHP code to establish a connection to a MySQL database, including the necessary credentials • [Code](Connecting_to_database/1_connection.php) | ||
|
||
2. Develop a PHP script to insert a new record into a MySQL database table.Ensure proper validation and sanitation of input data • [Code](Connecting_to_database/2_insert.php) | ||
|
||
3. Create a PHP script that retrieves and displays all records from a MySQL database table • [Code](Connecting_to_database/3_retrieve.php) | ||
|
||
4. Modify a specific record in a MySQL table using PHP. Ensure that the update is based on user input or specific criteria • [Code](Connecting_to_database/4_edit.php) | ||
|
||
5. Implement PHP code to delete a record from a MySQL table. Provide options for the user to select the record to be delete • [Code](Connecting_to_database/5_delete.php) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters