I have created an HTML form. I need to connect this to adatabase to update the phone number in the employee table
HTML:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01Transitional//EN”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html;
charset=windows-1252″>
</head>
<body link=”#0000EE” vlink=”#551A8B” text=”#000000″bgcolor=”#566573″
alink=”#EE0000″ background=”../DOC/brushed-alum.png”>
<form method=”post” action=”phonenumbers.php”>
<h1>Update Employee Phone Number Form</h1>
<br>
<br>
<h3>Enter the employee’s ID number.</h3>
<br>
<br>
Employee ID Number: <input name=”EmployeeNumber” type=”text”><br>
<br>
<h3>Enter the new phone number</h3>
Phone Number: <input name=”OfficePhone” type=”text”><br>
<br>
<input name=”submit” value=”Update” type=”submit”></form>
<p><a href=”forms.html”>Back to FormsPage</a></p>
<p>
</p>
</body>
</html>
PHP:
<?php
if(isset($_POST[‘submit’])){ //check if form has beensubmitted
//if form has been submitted
}
//values from the form will be pulled and set as the variablesbelow
$employeeNumber = filter_input(INPUT_POST,’EmployeeNumber’);
$officePhone = filter_input(INPUT_POST,’OfficePhone’);
//function to validate EmployeeNumber field input
function validId($id_raw){
$Id = stripcslashes(trim($id_raw));
//removes all slashes and
PayPal Gateway not configured
PayPal Gateway not configured