PHP Question

PHP - Check Textbox1's value with Button and Shows it in Text box 2

I have created page for inserting employee's attendance.

I just input the Employee Code, and by clicking "Check" Button, Employee Name will automatically showing.

But, I've got problem while run the page. The button didn't show the employee name when i click Check Button after filling the employee code.

What's wrong in my code ?


Employee Code : <input type="number" name="empl_kode" placeholder="Employee Code" required="required"><br>

<button type="button" name="cek_empl" value="cek_empl">Check</button><br>

Employee Name :<input type="text" name="empl_name" value="<?php $data->EMPL_NAME?>"placeholder="Employee Name"><br>


if (isset($_POST['cek_empl'])){
$Emp=new Employee();
while ($data= ibase_fetch_object($show)){


function showEmployee(){
$sql="SELECT empl_kode,empl_name FROM employee";
return $query;

New Attendance Page


Finally i can run my page with pure PHP. Here it is the code :

Function for calling the query :

function checkEmplcode($empl_kode){
    $sql="SELECT empl_kode, empl_name FROM employee where empl_kode='$empl_kode'";
    return $object_empl;

In form_empl.php, i add this syntax above the form input:

           if(isset($_POST['empl_kode']) && !empty($_POST['empl_kode'])){
           } else {
               echo "Syntax is not right! Please check again !";


        $Att=new Attendance();