Skip to content
Snippets Groups Projects
Commit 05a37c6d authored by vautrin33u's avatar vautrin33u
Browse files

ajout photos

parent cb8a33a7
Branches
No related tags found
1 merge request!1Master
......@@ -59,7 +59,9 @@ if (isset($decoded['images'])){
$nom = strtr( $nom, $accents );
foreach (array_filter(glob('Photos/*.jpg'), 'is_file') as $file){
if ('Photos/'.$nom.'.jpg' == $file){
echo '<img src="data:image/jpg;base64,'.base64_encode(file_get_contents($file)).'">';
echo $file;
}else{
echo '';
}
}
unset($decoded['images']);
......
......@@ -43,9 +43,23 @@ function afficheRecettes(recette){
}
const search = recette[i].titre;
const input = {
images : search
};
var xhr = new XMLHttpRequest();
xhr.open('POST', "Service.php", true);
xhr.onload = () => {
if (xhr.response != null){
image.src = xhr.responseText;
}
};
xhr.send(JSON.stringify(input));
// Ajout à la div de recettes
div.append(titre);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment