<!DOCTYPE html> <html> <head> <title>Drinkpedia</title> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="css/AdvancedSearch.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script type = "text/javascript" src="scripts/DataQuery.js"></script> </head> <body> <form autocomplete="off"> <div class="autocomplete" style="width:300px;"> <h2>Rechercher un aliment : </h2> <input id="myInput" autocomplete="off" type="text" name="myIngredient" placeholder="Ingrédient"> </div> </form> <script src="scripts/DataQuery.js"></script> <script src="scripts/Functions.js"></script> <script> let allIngredients = [<?php include 'scripts/Functions.php'; $first = true; foreach(getAllIngredients() as $ingredient) { if(!$first) echo ','; else $first = false; echo '"' . $ingredient . '"'; } ?>]; autocomplete(document.getElementById("myInput"), allIngredients); </script> </body> </html>