title: Unable to set PHP variables as values for input field in form
body: <p>I have a PHP file which SELECT's all from the row found  based on an SQL query. When I put the echo in a div, I get all information, but when I try to echo it into an input box in a form, it does not shows.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Please also note that I am aware that I am (most likely) making a lot of mistakes when it comes to security practices or programming standards, but this whole thing (PHPDesktop > <a href="https://github.com/cztomczak/phpdesktop" rel="nofollow noreferrer">https://github.com/cztomczak/phpdesktop</a>) will get packed into an EXE file which will run locally only (no need for an online connection as the SQLite3 DB gets packed in with the EXE), and I am still figuring out how to program this in the first place, so efficient and tidy coding are not high on my list yet ;-)</p>
  
  <p><strong>DO_CUSTEDIT.PHP</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>$custName = $_POST['custName'];
  
  $query = "SELECT * FROM `CustDB` WHERE CustName LIKE '%$custName%'";
  
  $result = $db-&gt;query($query);
  
  while ($row = $result-&gt;fetchArray()) {
        $custID = $row['CustID'];
        ......;
  }
  
  if (!$result) {
     echo $db-&gt;lastErrorMsg();
     $db-&gt;close();
     exit;
  } else {
     echo $custID;
     echo ......;
     $db-&gt;close();
     exit;
  }
  </code></pre>
  
  <p><strong>EDITCUST.PHP / Javascipt</strong></p>
  
  <pre><code>    &lt;script&gt;
        $(document).ready(function() {
          $("#subeditcust").on('click',function(e) {
            e.preventDefault();
            $.ajax( {
              url: "lib/do_editcust.php",
              method: "post",
              data: $("form").serialize(),
              dataType: "text",
              success: function(strMessage) {
                if (strMessage == "Customer updated successfully") {
                  $("#message").text(strMessage);
                  $("#neweditform").get(0).reset();
                  } else {
                    $("#message").text(strMessage);
                  }
                }
            });
          });
        });
      &lt;/script&gt;
  </code></pre>
  
  <p><strong>EDITCUST.PHP / HTML</strong> </p>
  
  <pre><code>      &lt;form id="editcustform" name="editcustform" action="" method="post"&gt;
          &lt;div class="row"&gt;
            &lt;div class="column-half" style="background-color:#fff"&gt;
              &lt;table&gt;
                &lt;tr&gt;
                  &lt;td&gt;
                    &lt;a&gt;Customer ID&lt;/a&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                    &lt;div class="inputb"&gt;
                      &lt;input type="text" name="custID" value="&lt;?php echo (isset($custID)) ? $custID: ''; ?&gt;" readonly/&gt;
                    &lt;/div&gt;
                  &lt;/td&gt;
                &lt;/tr&gt;
              &lt;/table&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;div class="row"&gt;
          &lt;table style="table-layout:fixed"&gt;
            &lt;td style="background-color: rgb(215,215,215); padding:0 10px;"&gt;
              &lt;button id="subeditcust" type="submit" class="mainbtn"&gt;Create&lt;/button&gt;
            &lt;/td&gt;
            &lt;td style="background-color: rgb(215,215,215); padding:0 10px;"&gt;
              &lt;button id="reseteditcust" type="reset" class="mainbtn"&gt;Reset&lt;/button&gt;
            &lt;/td&gt;
          &lt;/table&gt;
        &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>