Comment inserer une image dans un fichier PHP

ethan55 Messages postés 42 Date d'inscription   Statut Membre Dernière intervention   -  
 gef -
Bonjour je fais un projet en entreprise et j aimerais savoir comment inserer une image dans un fichier php
Si vous savez ,merci de me repondre quand vous pouvez
A voir également:

22 réponses

teebo Messages postés 33491 Date d'inscription   Statut Modérateur Dernière intervention   1 793
 
Hében dis donc, t'es pas rendu avec ton projet toi :-S


<html>
<body>
<?php
$titre_page='Acceuil';
include('http://localhost/entete3.php');

?>

<td rowspan="2" bgcolor="#FFFFFF">
<img src="C:/Documents and Settings/raphaelb/Desktop/TEST.jpg" width="100" height="47"/>
</td>

<?php
include('http://localhost/pied_page3.php');
?>
</body>
</html> 
4
Mingain
 
Le code peut aussi rester dans les balises php (par exemple pur ne l'executer dans une instruction conditionelle).
On va donc faire une sortie avec echo("");
Il ne faudra pas oublier ne changer les " dans le code HTML par des \"


<html>
<body>
<?php
$titre_page='Acceuil';
include('http://localhost/entete3.php');

echo("
<td rowspan=\"2\" bgcolor=\"#FFFFFF\">
<img src=\"C:/Documents and Settings/raphaelb/Desktop/TEST.jpg\" width=\"100\" height=\"47\"/>
</td>");


include('http://localhost/pied_page3.php');
?>
</body>
</html>


Par ailleur, vu le chemin de l'image (C:/Documents and Settings/raphaelb/Desktop/TEST.jpg), je pense que le serveur va avoir du mal à afficher une image sur ton bureau windows aux autres utilisateur !
0
lady-lucie
 
Salut ton chemin est pas bon et trop long je texplique fait toi un dossier dans tes documents Mes sites Web et un dossier mes images
dans se document tu va place ton site après avec ton éditeur de site je tes fait un exemble pour que tu conprenne mieux le chemin que tu doit prendre pour ton site dans tes doccument et images le reste de tes pages doit allez dans doccuments Mes sites Web jespère tavoir aidez
<html>
<body>
<?php>
<title>Acceuil</title>
include('http://localhost/entete3.php');
<TBODY>
<TR>
<TD>
<DIV align=center>
<TABLE id=table24
style="BORDER-COLLAPSE: collapse" cellPadding=0
width="100%" bgColor=#b7817d border=0>
<TBODY>
<TR>
<TD>
<p align="center"><img border="0" src="images/centres.jpg" width="800" height="460"></p>
</TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></DIV>
<DIV align=center>
<TABLE id=table13
style="BORDER-COLLAPSE: collapse" cellPadding=4
width="99%" border=0>
<TBODY>
<TR>
<TD>
<TABLE id=table26 borderColor=#b7817d
borderColorDark=#b7817d width="100%"
bgColor=#b7817d borderColorLight=#d0b7ac
background="images/glitter.gif"
border=1>
<TBODY>
<TR>
<TD width="24%"
background="images/TUILE_interieure.jpg">

<td rowspan="2" bgcolor="#FFFFFF">
<img src="images/centres.jpg" /Desktop/TEST.jpg" width="100" height="47"/>
</td>
0