0

How to coding to support import Excel file to auto insert Excel data into PHP+HTML input form?

Because I try coding but can't to support import Excel file to auto insert Excel data into PHP+HTML input form.

Sample code and file at the bottom.

  1. excelimport.xlsx (Excel file)

Download Link

  1. excelimport.php (PHP Code)
<!DOCTYPE html>
<html>
<body>

<h3>Select files to upload:</h3>

<form>
  <label for="myfile">Select files:</label>
  <input type="file" id="myfile" name="myfile" accept=".xlsx, .xls, .csv, .txt">
  <input type="submit"><br><br>
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" name="fname" value=""><br><br>
  <label for="lname">Last name:</label><br>
  <input type="text" id="lname" name="lname" value=""><br><br>
  <input type="submit" value="Submit">
</form> 

</body>
</html>
Sumate Mephokkij
  • 166
  • 2
  • 12
  • @AksenP Yes , send file to php via jQuery and autofill Excel data with same id to HTML input tag (example : autofill `input id="fname"` to Hello and autofill `input id="lname"` to World). – Sumate Mephokkij Feb 24 '20 at 07:37
  • 2
    **1.** send file to PHP. **2.** parse EXCEL file with third-party library. **3.** create response for AJAX/POST into HTML page. **4.** parse this response into desired fields. – Aksen P Feb 24 '20 at 07:44
  • **Good news** : I have answer to coding to support import Excel file to auto insert Excel data into PHP+HTML input form at [link.](https://stackoverflow.com/questions/60538248/how-to-parse-response-table-with-phpexcel-import-excel-file-to-input-tag-exampl) – Sumate Mephokkij Mar 11 '20 at 13:40
  • 1
    Nice work[.](https://stackoverflow.com/questions/60538248/how-to-parse-response-table-with-phpexcel-import-excel-file-to-input-tag-exampl) – Aksen P Mar 11 '20 at 14:30

0 Answers0