Professional Documents
Culture Documents
Learning Outcomes:
At the end of the lesson, the students are able to:
Understand the use of web forms.
Identify HTML Web Form Elements and their use.
Apply HTML Web Form Elements in a PHP Web page
Create a grading system web page using PHP Web Forms.
Create an HTML Form that will save, search, edit and delete record from the database.
Introduction
A web form is similar to paper or database forms because your customers fill out the forms using text
fields, checkboxes, or radio buttons. Examples of where web forms can be used is in the “checkout process”
during online shopping where the customer enters his credit card information or when he types a phrase into
a search engine’s search field box.
HTML form elements are used to capture user input. There are many different types of form elements
such as the text box, check box, drop down, submit button, and much more.
The form elements above are the most common used form elements. We will go into further detail on
each of these form elements:
Text Box Input. The text box input is used to capture text such as a name, email, address, or any other
type of text. To create an HTML text box we will use the input tag and specify that the type attribute to
be text.
Syntax: <input type="text" name="first_name">
Password Input. The password input is essentially the same thing as the Text Box input; however, it does
not show the text as the user types. Try it out in the example below:
Syntax: <input type="password" name="password">
Select Drop Down. A Drop Down is a specific list of options that a user can choose when selecting a
Drop Down menu. To create a Select Dropdown in HTML you would represent this inside of
<select></select> tags, then each option that you want to allow your user, you will specify with an
<option></option> tag inside the select tags. Take a look at the following example:
Syntax:
<select name="gender">
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Female">Not Specified</option>
</select>
Check Box. A check box is exactly what it sounds like, it's a box that you can click and it can be checked
or unchecked. When the check box is checked you are setting the check box to true. Otherwise if it is
unchecked you are saying that it is false. Take a look at how we can create an HTML check box below:
Syntax: <input type="checkbox" name="valid_ninja"> Are You a Ninja?
Radio Input. A radio select input allows a user a specific amount of options to select from. You can think
of this like a multiple choice select. The user can only select one of the options. Take a look at how to
create Radio Select Inputs in HTML:
Syntax:
<input type="radio" name="source" value="friend"> Through a friend<br>
<input type="radio" name=" source " value="website"> Read about it on a website<br>
<input type="radio" name=" source " value="radio"> Heard on a radio advertisement<br>
<input type="radio" name=" source " value="other"> Other Source<br>
Figure 2.8 – RadioButton
File Input. A File input is used to allow users to upload images or files. To create a File input element we
will use the input element and give it a type of file like the following:
Syntax: <input type="file" name="image">
Submit Button. Lastly we are going to need a way to submit our form with all the data. This is what the
submit button is used for. In order to use the submit button we will use another input element with a
type of submit:
Syntax: <input type="submit" value="Submit The Form">
Include your initials in naming your variables, class names, method names, parameters
and object names. Please see examples:
o dblJCBFee
o OrderJCBSystem
o computeJCBOrders
o txtJCBLName
Using any screen recording software (Open Broadcaster Software, Bandicam or
Filmora), record the machine problem output demonstration.
Submit the activity in the assignment section of the course in Neo LMS:
o Video Filename: ACT1-MOD3-CODE-INITIALS.
o YouTube link or URL of the recorded output demonstration.
Five (5) points deductions will be given to each submission protocol violations:
o Not including initials in variable names, object names, class names, method
names and project names.
o Not using activity and machine problem worksheets.
o Incorrect Filenames Format: ACT1-MOD3-CODE-INITIALS
o Incomplete Source codes and output screenshots in PDF or video output
demonstrations.
o Broken YouTube Links or no video demonstration outputs.
Any similarities on the source codes or any sign of “Copy and Paste” codes will be
marked as CHEATING and will be graded ZERO (0).
2. Right click module3-files in the workspace >> Select New Folder >> type act2-mod3-files.
3. Right click act2-mod3-files in the workspace >> Select New File >> type act2-mod3-is301-
initials.html
4. In act2-mod3-is301-initials.html code window add the following codes:
6. Open any web browser and type the url http://localhost/is301-bsis2x-initials/module3-
files/act2-mod3-files/act2-mod3-is301-initials.html The output should look like the image
below.
5. Right click act2-mod3-files in the workspace >> Select New File >> type act2-mod3-is301-
initials.php
6. In act2-mod3-is301-initials.php code window add the following codes:
7. Open any web browser and type the url http://localhost/is301-bsis2x-initials/module3-
files/act2-mod3-files/act2-mod3-is301-initials.html The output should look like the image
below.
a. Enter the following data
b. Click COMPUTE GRADE Button. The output should look like the image below:
Notes:
Include your initials in naming your variables, class names, method names, parameters
and object names. Please see examples:
o dblJCBFee
o OrderJCBSystem
o computeJCBOrders
o txtJCBLName
Using any screen recording software (Open Broadcaster Software, Bandicam or
Filmora), record the machine problem output demonstration.
Submit the activity in the assignment section of the course in Neo LMS:
o Video Filename: ACT2-MOD3-CODE-INITIALS.
o YouTube link or URL of the recorded output demonstration.
Five (5) points deductions will be given to each submission protocol violations:
o Not including initials in variable names, object names, class names, method
names and project names.
o Not using activity and machine problem worksheets.
o Incorrect Filenames Format: ACT2-MOD3-CODE-INITIALS
o Incomplete Source codes and output screenshots in PDF or video output
demonstrations.
o Broken YouTube Links or no video demonstration outputs.
Any similarities on the source codes or any sign of “Copy and Paste” codes will be
marked as CHEATING and will be graded ZERO (0).
</head>
<body>
</body>
</html>
</form>
</div>
C. Add the Text User Input elements. Provide the following codes after the inside the <form>
</form> tag.
<br>
<div class="form-group">
<label for="CustomerName">Customer Name:</label>
<input type="text" class="form-control" name="CustomerName"
id="CustomerName" placeholder="Enter customer name" required>
</div>
D. Add the RADIOBUTTON element FOR ORDERS. Provide the following codes after the inside the
<form> </form> tag after the previous code.
<div class="form-check">
<input class="form-check-input" type="radio" name="order" id="cheese"
value="Cheese Burger">
<label class="form-check-label" for="cheese">Cheese Burger 100.00</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="order" id="bigmc"
value="Big MacJabee">
<label class="form-check-label" for="bigmc">Big MacJabee 150.00</label>
</div>
</fieldset>
</div>
E. Add the CHECKBOXES element FOR EXTRAS. Provide the following codes after the inside the
<form> </form> tag after the previous code.
<div class="form-check">
<input class="form-check-input" type="checkbox" name="coles" id="coles"
value="Coleslaw 50.00">
<label class="form-check-label" for="cheese">Coleslaw 50.00</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="hamegg"
id="hamegg" value="Ham and Egg 100.00">
<label class="form-check-label" for="hamegg">Ham and Egg 100.00</label>
</div>
</fieldset>
</div>
F. Add the SELECT element FOR THE DRINKS. Provide the following codes after the inside the
<form> </form> tag after the previous code.
G. dd the Action or Command Button element. Provide the following codes after the inside the
<form> </form> tag after the previous code.
<!--ACTION/COMMAND BUTTONS-->
<br>
<div class="form-group">
<button type="submit" class="form-control btn btn-primary mb-2"
id="btnCompute">COMPUTE TOTAL AMOUNT</button>
</div>
8. Right click act3-mod3-files in the workspace >> Select New File >> type compute-order.php
9. CODE FOR THE COMPUTE ORDER. Type the following codes in the compute-order.php code
window:
<?php
//GET TEXT INPUTS
$strID = $_POST['CustomerID'];
$strName = $_POST['CustomerName'];
//COMPUTE ORDER
$dblTotal = $dblOrder + $dblPatty + $dblColes + $dblHamEgg + $dblDrinks;
//DISPLAY RECEIPT
echo "Customer ID: " . $strID . "<br>";
echo "Customer Name: " . $strName . "<br>";
echo "Total Amount: " . $dblTotal . "<br>";
?>
10. Open any web browser and type the url Open any web browser and type the url
http://localhost/is301-bsis2x-initials/module3-files/act2-mod3-files/act2-mod3-is301-
initials.html The output should look like the image below.
Notes:
Include your initials in naming your variables, class names, method names, parameters
and object names. Please see examples:
o dblJCBFee
o OrderJCBSystem
o computeJCBOrders
o txtJCBLName
Using any screen recording software (Open Broadcaster Software, Bandicam or
Filmora), record the machine problem output demonstration.
Submit the activity in the assignment section of the course in Neo LMS:
o Video Filename: ACT1-MOD3-CODE-INITIALS.
o YouTube link or URL of the recorded output demonstration.
Five (5) points deductions will be given to each submission protocol violations:
o Not including initials in variable names, object names, class names, method
names and project names.
o Not using activity and machine problem worksheets.
o Incorrect Filenames Format: ACT1-MOD3-CODE-INITIALS
o Incomplete Source codes and output screenshots in PDF or video output
demonstrations.
o Broken YouTube Links or no video demonstration outputs.
Any similarities on the source codes or any sign of “Copy and Paste” codes will be
marked as CHEATING and will be graded ZERO (0).
5. Right click mp1-mod3-files in the workspace >> Select New File >> type mp1-mod3-is301-
initials.php
6. Create a PHP file that will:
A. Compute the following:
i. Gross Pay = (((No. of Hours Work + No. Hours OT) – No. Hours Late) * Rate Per
Hour) + Uniform Allowance + Transportation Allowance
ii. Tax = Gross Pay * .10
iii. SSS = Gross Pay * .11
iv. PagIbig = Gross Pay * .12
v. PhilHealth = Gross Pay * .13
vi. Net Pay = Gross Pay – (Tax + SSS + PagIbig + PhilHealth)
7. Sample Data
Uniform Transpo
Employe First Middle Hours Hours Hours Rate Per Allowan Allowan
e# Last Name Name Name Status Work OT Late Hour ce ce
Di
001 Magkamali Perfecto Mahusay Probationary 35 10 5 250 400 500
002 Di Matulac Dabiana Hebi Regular 40 15 7 300 500 600
Di
003 Mahagilap Hassan Nuwer Permanent 45 8 10 350 600 800
Employee
Number Gross Pay Tax SSS PagIibig PhilHealth Net Pay
001 10900 1090 1199 1308 1417 5886
002 15500 1550 1705 1860 2015 8370
003 16450 1645 1809.5 1974 2138.5 8883
Notes:
Include your initials in naming your variables, class names, method names, parameters
and object names. Please see examples:
o dblJCBFee
o OrderJCBSystem
o computeJCBOrders
o txtJCBLName
Using any screen recording software (Open Broadcaster Software, Bandicam or
Filmora), record the machine problem output demonstration.
Submit the activity in the assignment section of the course in Neo LMS:
o Video Filename: MP1-MOD3-CODE-INITIALS.
o YouTube link or URL of the recorded output demonstration.
Five (5) points deductions will be given to each submission protocol violations:
o Not including initials in variable names, object names, class names, method
names and project names.
o Not using activity and machine problem worksheets.
o Incorrect Filenames Format: MP1-MOD3-CODE-INITIALS
o Incomplete Source codes and output screenshots in PDF or video output
demonstrations.
o Broken YouTube Links or no video demonstration outputs.
Any similarities on the source codes or any sign of “Copy and Paste” codes will be
marked as CHEATING and will be graded ZERO (0).
Notes:
Include your initials in naming your variables, class names, method names, parameters
and object names. Please see examples:
o dblJCBFee
o OrderJCBSystem
o computeJCBOrders
o txtJCBLName
Using any screen recording software (Open Broadcaster Software, Bandicam or
Filmora), record the machine problem output demonstration.
Submit the activity in the assignment section of the course in Neo LMS:
o Video Filename: MP2-MOD3-CODE-INITIALS.
o YouTube link or URL of the recorded output demonstration.
Five (5) points deductions will be given to each submission protocol violations:
o Not including initials in variable names, object names, class names, method
names and project names.
o Not using activity and machine problem worksheets.
o Incorrect Filenames Format: MP2-MOD3-CODE-INITIALS
o Incomplete Source codes and output screenshots in PDF or video output
demonstrations.
o Broken YouTube Links or no video demonstration outputs.
Any similarities on the source codes or any sign of “Copy and Paste” codes will be
marked as CHEATING and will be graded ZERO (0).
A. Customer Information
i. Customer Number
ii. Last Name
iii. First Name
iv. Middle Name
v. Gender
vi. Birthday
vii. Email Address
B. Pizza Sizes (RadioButton)
i. Regular 300.00
ii. Large 500.00
iii. Family 800.00
iv. Extra Large 1000.00
C. Extra Toppings (CheckBox)
i. Cheese 50.00
ii. Ham 60.00
iii. Bacon 80.00
iv. Pepperoni 100.00
D. Pizza Flavor (RadioButton)
i. Hawaiian 50.00
ii. Pepperoni and Cheese 100.00
iii. Combination 150.00
iv. Manager's Choice 200.00
E. Drinks (ComboBox)
i. Softdrinks 30.00
ii. Mango Juice 35.00
iii. Pineapple Juice 40.00
iv. Hot Coffee 45.00
Notes:
Include your initials in naming your projects, variables, class names, method names,
parameters and object names. Please see examples:
o dblJCBFee
o OrderJCBSystem
o computeJCBOrders
o txtJCBLName
Using any screen recording software (Open Broadcaster Software, Bandicam or
Filmora), record the machine problem output demonstration.
Submit the activity in the assignment section of the course in Neo LMS:
o Video Filename: MP3-MOD3-CODE-INITIALS.
o YouTube link or URL of the recorded output demonstration.
Five (5) points deductions will be given to each submission protocol violations:
o Not including initials in naming your projects, variables, class names, method names,
parameters and object names.
o Not using activity and machine problem worksheets.
o Incorrect Filenames Format: MP3-MOD3-CODE-INITIALS
o Incomplete Source codes and output screenshots in PDF or video output
demonstrations.
o Broken YouTube Links or no video demonstration outputs.
Any similarities on the source codes or any sign of “Copy and Paste” codes will be marked as
CHEATING and will be graded ZERO (0).
A. What is the importance of a Web Form in a Web Application? Provide sample applications of Web
Forms.?
B. Enumerate three (3) HTML Form Elements and discuss its purpose or usage in a HTML Web Page?
C. Based on the activities and machine problems discuss the use of the following:
a. HTML Forms
b. PHP Scripts
Notes:
Use the activity sheet provided in assignment section of the subject in the LMS.
Check for plagiarism. Scan your answers at https://plagiarismdetector.net/
o Acceptance Rating: 80% to 100% Uniqueness.
o Include the “Screen Shot” of the result in the activity sheet.
Submit the activity in PDF Format in the assignment section of the subject in the LMS.
Filename: EXP-MOD3-CODE-INITIALS.
Submit the related studies in PDF Format.
Five (5) points deductions will be given to each submission protocol violations:
o Not using the activity worksheets.
o Incorrect Filename Format: ACTIVITY_TITLE_INITIALS.PDF
o Not attaching the Plagiarism Scan Report Screen Shot.
Any similarities on the answers, or any sign of “Copy and Paste” from the internet or
other student’s output will be marked as CHEATING and will be graded ZERO (0).