1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
<?php
include("../db_connect.php");
if(!isset($_GET['photo_de_la_personne_disparue']) OR is_numeric($_GET['photo_de_la_personne_disparue'])) // Si l'argument id n'existe pas , ou est un nombre, on arrete le script
{
exit;
}else{
$picture = $_GET['photo_de_la_personne_disparue'];
$whoIsInThePicture = explode("_", $picture);
$whoIsInThePicture[0]; // first name
$whoIsInThePicture[1]; // last name
$sql2='SELECT * FROM tb_individus_fr WHERE fd_firstname LIKE "'.$whoIsInThePicture[0].'" AND fd_name LIKE "'.$whoIsInThePicture[1].'"';
$query2=mysql_query($sql2) or die('Erreur SQL !'.$sql2.'<br>'.mysql_error());
$nb2 = mysql_num_rows($query2);
if($nb2<1){
echo '<img src="noentry.jpeg" />';
} else{
//header('Content-type: image/jpeg');
// Ca peut être image/png , image/gif etc! Ca permettra d'indiquer au navigateur que je renvoie une image
while($data = mysql_fetch_assoc($query2)){
if(strlen($data['fd_picture']) < 3){
//ALORS AFFICHE L'IMAGE QUI SE TROUVE DANS LE DOSSIER IMG/IMAGE.JPG
// echo '<img src="img/image.jpg" />
// MAIS EN BINARY
}else{
// on affiche les informations de l'enregistrement en cours
$img=$data['fd_picture'];
echo $img;
}
}
}
}
include("../db_disconnect.php");
?> |
Partager