Reloading a form for data entry in php

Hello all,

I’ve recently started to build a new database management system using mysql and php. I soon saw that my 2 select drop down boxes won’t reload with options(data coming from mysql tables) after I submit the form. even reloading the form does not repopulate the select box. I have to close the form and re-open it in order to add more data into the form. I would like to have the ability to post an entry and keep going at entering more entries on the same form. is this something php can handle or have to start using javascript?

check into session_start() should help you out.

You can also save entries to the DB and depending on how you are storing the data, records can be updated if record id is in place or inserted if id is not present. Below post processing you query for this record and populate the form. This allows user to come back later and continue where they left off.

Are you saying that the select menus are empty after you submit the form? Or just that they don’t return to the default option?

Could you post your PHP code that generates the form?

Yes the select tags are empty after I submit the form. Pepster post suggested that I used session() I think I can save the select queries that populates my select tags in $_SESSION?

I think Pepster and Drummin are talking about repopulating the form with user input. If you’re generating a form with PHP and populating the select options from a DB, the options should still be there after submitting the form. That’s why it would be helpful to see some code, then we could find out what’s going on.

Here is the code. Please understand I am only one month into learning PHP. I know my code looks bad, but as I progress in learning I will clean it up.

<!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" -->
 
<?php
//DB Connection and apps variables//
include ("../../include/connect.php");
include ("../../include/appvar.php");
//error_reporting (E_ALL ^ E_NOTICE);
//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>';

				}
 }
?>

<!-- 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)){?>
                    <option type"input" value="<?php echo $option['jobtitleid']; ?>"> <?php echo $option['jobtitle'];  ?></option>
                    <?php }?>
                  </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 * FROM employer";
                   $empresult= mysqli_query($dbc, $employer);
                   while($optionemp = mysqli_fetch_array($empresult)){?>
                  <option type"input" value="<?php echo $optionemp['employerid']; ?>"> <?php echo $optionemp['employer'];?></option>
                  <?php }  ?>
                  </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 -->

First I would move all that processing above doctype.
I noticed you used the attribute type=“input” instead of class=“input” on those option selects.

Now after processing and just before doctype, query employee table and set their stats to variables. These can be echoed as values for input type=“text” inputs or adding checked=“checked” to the select option that matches. For those selects I would only query for the fields needed then do the compare like so.

<?php
    $employer = "SELECT employerid,employer FROM employer";
    $empresult= mysqli_query($dbc, $employer);
    while($optionemp = mysqli_fetch_array($empresult)){
         
        // $employerid from main employee query
        $selectedemployerid = ($employerid == $optionemp['employerid'] ? ' selected="selected"' : '');
        echo '<option class"input" value="' . $optionemp['employerid'] . '"' . $selectedemployerid .'>' . $optionemp['employer'] . '</option>'."\r";
    }  
?>

Anyway, hope that gets you moving forward.

I tried what you suggested and still getting only one instance of the content of the select tags. it works great at populating the option tag like my version did but only once. I need the form to be data entry friendly where I can enter many employees one after another while using the same form. Thanks for giving this a shot I appreciate the time you spent responding.

So are you saying you are wanting this form repeating with already entered employees values listed in those form fields so they can be edited? Like one insert, the rest update? I didn’t see any query for these employees and loop.

Not exactly. OK let me try to explain as best I can(english is not my first language, please bare with me)

What I am building is a database management system.
THis employee module is only one of many module that I will be creating.
I will have a project module with relating task assigned to project and so on.
now lets say I have a batch of new employee being hired for a new site in another city. all these new employees have to be entered in the system. a clerk might have a list of new employee and use the form as data entry to enter lets say 20 new employees in the system. so in essence what I want is to add an employee and save it to the database. refresh the form and add a new employee, once that done keep going until all 20 new employees have been entered using the same form.

So it is just the selects that need to stay “sticky”? If that’s the case, go with Pepster’s suggestion and set for example employerid to session and use that session to compare to for selected=“selected”.
So near the top of your page you’d set the session.

if (isset($_POST['employerid'])):    
    $_SESSION['employerid'] = $_POST['employerid'];
endif;

Then in the select you would check for and use the session.

$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";
}

At the very top of the page BEFORE any output, you would need

session_start();

Yes, that is what I was thinking would work using the global $_SESSION variable. I will try your code and add a
if( isset($employerid) sticky at the bottom of the option tag, hopefully that will work. Keeping my finger crossed :smile:

OK, i didn’t worked. I can still only see one instance of the select tag. As soon as I submit the form the select tag becomes blank; can’t reuse it. if I close the page and reloaded it → everything is back inside the select box as it should. I been working on this for a week. I think I am going to delete this page and start from scratch. There has got to be something in the page that is screwing my form and just I cant find for the life of me what it is. I much appreciate your patience and willingness to help me move forward, thank you very much, you are a true gentleman…

You would be check for the session.

$selectedemployerid = (isset($_SESSION['employerid']) && $_SESSION['employerid'] == $optionemp['employerid'] ? ' selected="selected"' : '');

Remember that session_start(); has to be a the very top of the page before ANYTHING is sent to the browser.

yes, it is right at the top, first line after my opening <?php tag which is above the <!doctype html>

yes, it is right at the top, first line after my opening <?php tag which is above the html

I have an idea. lol this might work: if I understand my problem correctly : it is a query failure to display data inside my option tag. what if I eliminate the query all together? and instead create an array in the page itself as an output of the query result? The array of employers would then always be on the page “hard coded” and can then reference this output to the option tag?

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 -->

well the only difference I was able to see was that you coded the jobtitle select tag which I didn’t on my form. My start session() was on top, yours came after my database connection include file. I also noticed that you created a session variable for jobtitle. Beside that, pretty much everything looks the same. I tried copying and pasting your codes over mine in the event I didn’t noticed something and when I tried it, same resultt: Works great at uploading one record to the database but the select tags are empty after the page has refreshed: can’t reuse it :frowning: