I just did a very quick edit of your page so don’t replace what you have, just use it so compare to yours.
<?php
//DB Connection//
include "../../include/connect.php";
//error_reporting (E_ALL ^ E_NOTICE);
session_start();
if (isset($_POST['employerid'])):
$_SESSION['employerid'] = $_POST['employerid'];
endif;
if (isset($_POST['jobtitleid'])):
$_SESSION['jobtitleid'] = $_POST['jobtitleid'];
endif;
//check to see if the form has been set//
if (isset($_POST['submit'])) {
//Variables for employee form//
$employerid= mysqli_real_escape_string($dbc,trim($_POST['employerid']));
$jobtitleid= mysqli_real_escape_string($dbc, trim($_POST['jobtitleid']));
$firstname= mysqli_real_escape_string($dbc, trim($_POST['firstname']));
$lastname= mysqli_real_escape_string($dbc, trim($_POST['lastname']));
$address= mysqli_real_escape_string($dbc, trim($_POST['address']));
$city= mysqli_real_escape_string($dbc, trim($_POST['city']));
$province= mysqli_real_escape_string($dbc, trim($_POST['province']));
$country= mysqli_real_escape_string($dbc, trim($_POST['country']));
$postalcode= mysqli_real_escape_string($dbc, trim($_POST['postalcode']));
$phone= mysqli_real_escape_string($dbc, trim($_POST['phone']));
$email= mysqli_real_escape_string($dbc, trim($_POST['email']));
$employeecomment = mysqli_real_escape_string($dbc, trim($_POST['employeecomment']));
$employeepic = mysqli_real_escape_string($dbc, trim($_FILES['employeepic']['name']));
$employeepic_type = $_FILES['employeepic']['type'];
$employeepic_size = $_FILES['employeepic']['size'];
//Validate picture type//
if(!empty($employeepic)) {
if ((($employeepic_type == 'image/jpg') ||($employeepic_type == 'image/jpeg') ||($employeepic_type == 'image/gif') ||
($employeepic_type == 'image/png')) && ($employeepic_size <= EMP_MAXSIZE) && ($employeepic_size > 0)){
preg_replace('#[\s\&\@\#\$\%\(\)\[\]\&]#','', $employeepic);
// Move the file to the target upload folder
$target = (EMP_UPLOADPATH .$firstname.$employeepic);
if(move_uploaded_file($_FILES['employeepic']['tmp_name'],$target)){
$employee = $firstname. " " .$lastname;
$employee_pic = $firstname.$employeepic;
}
}else{
$filetoobig =' <p class="error"> There was a problem uploading your picture. Maximum size is 30K and must be in jpg, jpeg or pjpeg format</p>';
@unlink($_FILES['employeepic']['tmp_name']);
$employeepic = '';
}
}
// pulling out records to check for duplicate
$query2 ="SELECT firstname, lastname FROM employee WHERE firstname='$firstname' AND lastname='$lastname'";
$duplicate = mysqli_query($dbc, $query2);
if (mysqli_num_rows($duplicate) <> 0){
$query3 = "SELECT employeeid FROM employee WHERE firstname='$firstname' AND lastname ='$lastname'";
$result3 =mysqli_query($dbc, $query3);
if($result3) {
while($row = mysqli_fetch_assoc($result3)) {
$newpic= $row['employeeid'];
}
}
$query2 = "UPDATE employee SET employeepic = '$employee_pic' WHERE employeeid = '$newpic'";
$result2 = mysqli_query($dbc, $query2);
mysqli_close($dbc);
$successup ='<p class="success">You successfully updated this employee record</p>';
}else{
//query to populate employee form//
$query = "INSERT INTO employee (employerid, jobtitleid, firstname, lastname, address, city, province, country, postalcode," .
"phone, email, employeecomment, employeepic) VALUES ('$employerid', '$jobtitleid', '$firstname', '$lastname'," .
" '$address', '$city', '$province', '$country', '$postalcode', '$phone', '$email','$employeecomment','$employee_pic')";
$result = mysqli_query($dbc, $query);
mysqli_close($dbc);
$success ='<p class="success">Record created successfully</p>';
}
}
//apps variables//
include ("../../include/appvar.php");
?>
<!doctype html>
<!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
<!--[if IE 7]> <html class="ie7 oldie"> <![endif]-->
<!--[if IE 8]> <html class="ie8 oldie"> <![endif]-->
<!--[if gt IE 8]><!--> <html class=""><!-- InstanceBegin template="/Templates/mastertemplate.dwt" codeOutsideHTMLIsLocked="false" -->
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- InstanceBeginEditable name="title" --><title>Add/Update Employees</title> <!-- InstanceEndEditable -->
<link href="../../boilerplate.css" rel="stylesheet" type="text/css">
<link href="../../style/css.css" rel="stylesheet" type="text/css">
<!--
To learn more about the conditional comments around the html tags at the top of the file:
paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
* insert the link to your js here
* remove the link below to the html5shiv
* add the "no-js" class to the html tags at the top
* you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
-->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="../../respond.min.js"></script>
</head>
<body>
<!-- InstanceBeginEditable name="body" -->
<!-- InstanceEndEditable -->
<div class="gridContainer clearfix">
<!-- InstanceBeginEditable name="header" -->
<header id="header" class="fluid "><h1 class="header h1">
<?php include ("../../include/header/header_employee.php");?>
</h1></header><!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="navigation" -->
<nav id="navigation" class="fluid ">
<?php include ("../../include/navigation/employee_nav.php");?>
</nav><!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="main" -->
<section id="main" class="fluid ">
<!--Error messages-->
<?php
if(isset($duplicateerror)){
echo $duplicateerror;
}
if(isset($success)){
echo $success;
}
if(isset($filetoobig)){
echo $filetoobig;
}
if(isset($successup)){
echo $successup;
}
?>
<form enctype="multipart/form-data" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
<input type="hidden" name"MAX_FILE_SIZE" value="32768" />
<label for"jobtitleid" class="label">Jobtitle</label>
<select required name="jobtitleid" class="input" id="jobtitleid"/>
<option value="select">Select Job Title</option>
<?php
$jobtitle = "SELECT * FROM jobtitle";
$jobresult= mysqli_query($dbc, $jobtitle);
while($option = mysqli_fetch_array($jobresult)){
$selectedjobtitleid = (isset($_SESSION['jobtitleid']) && $_SESSION['jobtitleid'] == $option['jobtitleid'] ? ' selected="selected"' : '');
echo '<option class"input" value="' . $option['jobtitleid'] . '"' . $selectedjobtitleid .'>' . $option['jobtitle'] . '</option>'."\r";
}
?>
</select>
<label for"employerid" class="label">Employer</label>
<select required name="employerid" class="input" id="employerid"/>
<option value="select" >Select employer</option>
<?php
$employer = "SELECT employerid,employer FROM employer";
$empresult= mysqli_query($dbc, $employer);
while($optionemp = mysqli_fetch_array($empresult)){
$selectedemployerid = (isset($_SESSION['employerid']) && $_SESSION['employerid'] == $optionemp['employerid'] ? ' selected="selected"' : '');
echo '<option class"input" value="' . $optionemp['employerid'] . '"' . $selectedemployerid .'>' . $optionemp['employer'] . '</option>'."\r";
}
?>
</select>
<label for="firstname" class="label" >First Name:</label>
<input name="firstname" type="text" required class="input" id="firstname"/>
<label for="lastname" class="label" >Last Name:</label>
<input name="lastname" type="text" required class="input" id="lastname" />
<label for="address" class="label" >Address:</label>
<input type="text" class="input" id="address" name="address" />
<label for="city" class="label" >City:</label>
<input type="text" class="input" id="city" name="city" />
<label for="province" class="label" >Province:</label>
<input type="text" class="input" id="province" name="province" />
<label for="country" class="label" >Country:</label>
<input type="text" class="input" id="country" name="country" />
<label for="postalcode" class="label" >Postal Code:</label>
<input type="text" class="input" id="postalcode" name="postalcode"/>
<label for="phone" class="label" >Phone:</label>
<input type="text" class="input" id="phone" name="phone"/>
<label for="email" class="label" >Email:</label>
<input type="text" class="input" id="email" name="email" /><br /><br />
<label class="label" id="employeecommentlabel" for="employeecomment">Employee Comment:</label><br />
<textarea name="employeecomment" class="textarea" type="text"></textarea><br />
<label class="label" id="employeepiclabel"for="employeepic">Employee Picture:</label>
<input class="input"type="file" name="employeepic" id="employeepic" />
<input class="input" id="empsubmit" type="submit" name="submit" value="Save"/>
</form>
</section><!-- InstanceEndEditable -->
</div>
</body>
<!-- InstanceEnd --></html>
<!-- InstanceBeginEditable name="footer" -->
<footer id="footer" class="fluid ">
Footer
</footer><!-- InstanceEndEditable -->