Probleme de visualisation d'image
waldpest
-
waldpest -
waldpest -
Bonjour,
Voila j'ai un petit souci concernant l'affichage des images .
j'ai fait en sorte que dans mon URL en tapant simplement
http://localhost/Association/lecture.php/nom de l'association
il trouve ma page de visualisation du contenu, seulement il ne retrouve pas mes images alors qu'avant il me les trouver.
voici le code :
<?php
session_start();
function url_actuelle()
{
return "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
}
$ex = explode("/", url_actuelle());
echo $ex[3]. "<br>";
echo $ex[4]. "<br>";
$nom = $ex[5];
echo url_actuelle();
$recherche = "SELECT * FROM coordonnees WHERE nom = \"$nom\"";
include_once("connex.inc.php");
$connex = connex("association", "myparam");
$result = mysql_query($recherche);
$ligne = mysql_fetch_array($result);
$id = $ligne['0'];
$pseudo = $ligne['1'];
$pass = $ligne['2'];
$nom = $ligne['3'];
$responsable = $ligne['4'];
$description = $ligne['5'];
$description2 = $ligne['6'];
$description3 = $ligne['7'];
$description4 = $ligne['8'];
$adresse = $ligne['9'];
$cp = $ligne['10'];
$localite = $ligne['11'];
$tel = $ligne['13'];
$fax = $ligne['14'];
$mail = $ligne['15'];
function reduction($image)
{
$dim=getimagesize($image);
$pixmaxi=200;
$largeur=$dim[0];
$hauteur=$dim[1];
if ($largeur>$pixmaxi)
{
$reduire=$pixmaxi/$largeur;
$largeur=$pixmaxi;
$hauteur=ceil($hauteur*$reduction);
}
if (file_exists($image))
{
echo '<img src="C:/Program Files/wamp/www/Association/',$image,'" heigth="',$hauteur,'" width="',$largeur,'">';
}
else
{
echo 'Image non disponible';
}
}
?>
<html>
<head></head>
<body>
<table align="center" border= "0">
<tr align="center">
<td align ="center">
<?php
echo "<h4>$nom</h4>";
echo $adresse . "<br>";
echo $cp . " " .$localite . "<br>";
echo "tél :" . $tel . "<br>";
echo "fax :" . $fax . "<br>";
echo "email : " . $mail . "<br>";
?>
</td>
<td>
<?php
echo reduction("logo/$id.jpg");
?>
</td>
</tr>
<?php
if(file_exists("photo/image1/$id.jpg")){
echo "<tr align=\"center\">";
echo "<td>";
echo reduction("photo/image1/$id.jpg");
}
echo "</td>";
echo "<td>";
echo $description;
echo "</td>";
echo "</tr>";
if(file_exists("photo/image2/$id.jpg")){
echo "<tr align=\"center\">";
echo "<td>";
echo $description2;
echo "</td>";
echo "<td>";
echo reduction("photo/image2/$id.jpg");
echo "</td>";
echo "</tr>";
}
if(file_exists("photo/image3/$id.jpg")){
echo "<tr align=\"center\">";
echo "<td>";
echo reduction("photo/image3/$id.jpg");
echo "</td>";
echo "<td>";
echo $description3;
echo "</td>";
echo "</tr>";
}
if(file_exists("photo/image4/$id.jpg")){
echo "<tr align=\"center\">";
echo "<td>";
echo $description4;
echo "</td>";
echo "<td>";
echo reduction("photo/image4/$id.jpg");
echo "</td>";
echo "</tr>";
}
?>
</body>
</html>
Merci pour votre aide
Voila j'ai un petit souci concernant l'affichage des images .
j'ai fait en sorte que dans mon URL en tapant simplement
http://localhost/Association/lecture.php/nom de l'association
il trouve ma page de visualisation du contenu, seulement il ne retrouve pas mes images alors qu'avant il me les trouver.
voici le code :
<?php
session_start();
function url_actuelle()
{
return "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
}
$ex = explode("/", url_actuelle());
echo $ex[3]. "<br>";
echo $ex[4]. "<br>";
$nom = $ex[5];
echo url_actuelle();
$recherche = "SELECT * FROM coordonnees WHERE nom = \"$nom\"";
include_once("connex.inc.php");
$connex = connex("association", "myparam");
$result = mysql_query($recherche);
$ligne = mysql_fetch_array($result);
$id = $ligne['0'];
$pseudo = $ligne['1'];
$pass = $ligne['2'];
$nom = $ligne['3'];
$responsable = $ligne['4'];
$description = $ligne['5'];
$description2 = $ligne['6'];
$description3 = $ligne['7'];
$description4 = $ligne['8'];
$adresse = $ligne['9'];
$cp = $ligne['10'];
$localite = $ligne['11'];
$tel = $ligne['13'];
$fax = $ligne['14'];
$mail = $ligne['15'];
function reduction($image)
{
$dim=getimagesize($image);
$pixmaxi=200;
$largeur=$dim[0];
$hauteur=$dim[1];
if ($largeur>$pixmaxi)
{
$reduire=$pixmaxi/$largeur;
$largeur=$pixmaxi;
$hauteur=ceil($hauteur*$reduction);
}
if (file_exists($image))
{
echo '<img src="C:/Program Files/wamp/www/Association/',$image,'" heigth="',$hauteur,'" width="',$largeur,'">';
}
else
{
echo 'Image non disponible';
}
}
?>
<html>
<head></head>
<body>
<table align="center" border= "0">
<tr align="center">
<td align ="center">
<?php
echo "<h4>$nom</h4>";
echo $adresse . "<br>";
echo $cp . " " .$localite . "<br>";
echo "tél :" . $tel . "<br>";
echo "fax :" . $fax . "<br>";
echo "email : " . $mail . "<br>";
?>
</td>
<td>
<?php
echo reduction("logo/$id.jpg");
?>
</td>
</tr>
<?php
if(file_exists("photo/image1/$id.jpg")){
echo "<tr align=\"center\">";
echo "<td>";
echo reduction("photo/image1/$id.jpg");
}
echo "</td>";
echo "<td>";
echo $description;
echo "</td>";
echo "</tr>";
if(file_exists("photo/image2/$id.jpg")){
echo "<tr align=\"center\">";
echo "<td>";
echo $description2;
echo "</td>";
echo "<td>";
echo reduction("photo/image2/$id.jpg");
echo "</td>";
echo "</tr>";
}
if(file_exists("photo/image3/$id.jpg")){
echo "<tr align=\"center\">";
echo "<td>";
echo reduction("photo/image3/$id.jpg");
echo "</td>";
echo "<td>";
echo $description3;
echo "</td>";
echo "</tr>";
}
if(file_exists("photo/image4/$id.jpg")){
echo "<tr align=\"center\">";
echo "<td>";
echo $description4;
echo "</td>";
echo "<td>";
echo reduction("photo/image4/$id.jpg");
echo "</td>";
echo "</tr>";
}
?>
</body>
</html>
Merci pour votre aide
A voir également:
- Probleme de visualisation d'image
- Volet de visualisation - Guide
- Image iso - Guide
- Reduire taille image - Guide
- Légender une image - Guide
- Visualisez cette image avec un logiciel d'édition d'images. combien y a-t-il de pixels noirs sur le camion ? - Télécharger - Photo & Graphisme