Exercise Given File Exercise 3html Within File Form Fields Required Insert New Record Cust Q43874059
For this exercise, you have been given the file exercise-3.html.Within this file is a form with the fields required to insert a newrecord into the customer database table. You are to create anotherfile, exercise-3.php, which will process the input fromexercise-3.html which is sent via the POST method.
Using the schema in figure 2 and the data received fromexercise-3.html insert a new record into the database. Uponsuccess, print to the page “Successfully Added a New Record to theCustomer Table with the ID of: #”. The ‘#’ represents the lastinserted ID. If it fails, “Failed to insert new record” should beprinted to the page.
For maximum marks for this exercise your data needs to besanitised and validate for type and size in PHP.
html code:
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
<title>Exercise 3</title>
<style>
label { width:150px; display:inline-block; }
</style>
</head>
<body>
<form action=”exercise-3.php” method=”POST”>
<p>
<label for=”custNum”>Customer Number:</label>
<input id=”custNum” name=”custNum” type=”text”>
</p>
<p>
<label for=”title”>Title:</label>
<select name=”title” id=”title”>
<option value=”” selected disabled>SelectTitle</option>
<option value=”Mr”>Mr</option>
<option value=”Miss”>Miss</option>
<option value=”Ms”>Ms</option>
<option value=”Dr”>Dr</option>
<option value=”Prof”>Prof</option>
</select>
</p>
<p>
<label for=”firstName”>First Name:</label>
<input type=”text” name=”firstName” id=”firstName”>
</p>
<p>
<label for=”familyName”>Family Name:</label>
<input type=”text” name=”familyName” id=”familyName”>
</p>
<p>
<label for=”contact”>Contact:</label>
<input type=”text” name=”contact” id=”contact”>
</p>
<p>
<label for=”email”>Email:</label>
<input type=”text” name=”email” id=”email”>
</p>
<p>
<label for=”houseNum”>House Number:</label>
<input type=”text” name=”houseNum” id=”houseNum”>
</p>
<p>
<label for=”street”>Street:</label>
<input type=”text” name=”streat” id=”street”>
</p>
<p>
<label for=”suburb”>Suburb:</label>
<input type=”text” name=”suburb” id=”suburb”>
</p>
<p>
<label for=”state”>State:</label>
<select name=”state” id=”state”>
<option value=”” selected disabled>SelectState</option>
<option value=”NSW”>NSW</option>
<option value=”QLD”>QLD</option>
<option value=”VIC”>VIC</option>
<option value=”TAS”>TAS</option>
<option value=”NT”>NT</option>
<option value=”WA”>WA</option>
<option value=”SA”>SA</option>
</select>
</p>
<p>
<label for=”postCode”>Post Code:</label>
<input type=”text” name=”postCode” id=”postCode”>
</p>
<p>
<input type=”submit” value=”Submit” name=”Submit”>
</p>
</form>
</body>
</html>



Please screenshot result and post php code
Client Name Suburb Mary Hadalittlelamb Meadowville Buzz** Lightyear **IntergalacticHQ Campbelltown Bradbury Ilene Over Simple Ton Under Standing Camden Figure 1 customer customercar id INT(11) id INT(11) custNum INT(11) custNum INT(11) O title VARCHAR(20) rego VARCHAR(6) make VARCHAR(15) firstName VARCHAR(20) familyName VARCHAR(30) contact VARCHAR(10) model VARCHAR(30) yearMan VARCHAR(4) email VARCHAR(60) Indexes houseNum VARCHAR(10) street VARCHAR(20) suburb VARCHAR(20) state VARCHAR(3) postCode VARCHAR(4) Indexes Figure 2 Hint: To tackle this exercise focus on selecting all cars for a particular customer first, and then focus on getting the data from the GET request to perform your query. Remember, you should sanitise anything which is derived from the user! Cars for Simple Ton Rego: SMART, Make: Smart, Model: Fortwo Turbo Coupe, Year: 2010 Figure 3 Show transcribed image text Client Name Suburb Mary Hadalittlelamb Meadowville Buzz** Lightyear **IntergalacticHQ Campbelltown Bradbury Ilene Over Simple Ton Under Standing Camden Figure 1
customer customercar id INT(11) id INT(11) custNum INT(11) custNum INT(11) O title VARCHAR(20) rego VARCHAR(6) make VARCHAR(15) firstName VARCHAR(20) familyName VARCHAR(30) contact VARCHAR(10) model VARCHAR(30) yearMan VARCHAR(4) email VARCHAR(60) Indexes houseNum VARCHAR(10) street VARCHAR(20) suburb VARCHAR(20) state VARCHAR(3) postCode VARCHAR(4) Indexes Figure 2
Hint: To tackle this exercise focus on selecting all cars for a particular customer first, and then focus on getting the data from the GET request to perform your query. Remember, you should sanitise anything which is derived from the user! Cars for Simple Ton Rego: SMART, Make: Smart, Model: Fortwo Turbo Coupe, Year: 2010 Figure 3
Expert Answer
Answer to For this exercise, you have been given the file exercise-3.html. Within this file is a form with the fields required to …
OR