Salut tout le monde... J'ai oublié comment on faisait pour appelé un champ php dans ma page html pourriez vous me redonner la synthaxe. Par exemple pour afficher le titre, la description et la date dans ma page svp.
Voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php 
 $db=mysql_connect("localhost", "root", ""); 
 if (!$db) { 
   die('Impossible de se connecter : ' . mysql_error()); 
}
 
 mysql_select_db("basemg", $db); 
 if (!$db) { 
   die('Impossible de se connecter : ' . mysql_error()); 
}
 
 $sql='SELECT num, titre, description, date FROM tablemg WHERE date = (SELECT MAX(date) FROM tablemg)'; 
 $req=mysql_query($sql) or die(mysql_error()); 
 $num=mysql_num_rows($req); 
 echo '<table>'; 
while ($row=mysql_fetch_array($req)) 
{ 
  echo '<tr>';
 
  echo '<td>'.$row['titre'].'</td>'; 
  echo '<td>'.$row['description'].'</td>'; 
  echo '<td>'.$row['date'].'</td>'; 
  echo '</tr>'; 
} 
echo '</table>'; 
 mysql_free_result($req); 
 mysql_close($db); 
?> 
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Accueil</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
</head>
<link rel="stylesheet" type="text/css" href="Style.css">
<body>
<table width="807" border="0" align="left" cellpadding="0" cellspacing="0">
  <tr>
    <td width="807" height="22" background="images/title.gif" class="menu"><div align="center">Accueil</div></td>
  </tr>
  <tr>
    <td height="525" align="center" valign="top" bgcolor="#FFFF00"><table width="753" height="502" border="0" cellpadding="0" cellspacing="1">
        <tr>
          <td width="751" height="500" align="center" valign="top" bgcolor="#FFFFFF"><table width="678" border="0" cellspacing="5" cellpadding="0">
              <tr>
                <td width="668" height="466"><p>Bonjour et bienvenue &agrave; tous sur la nouvelle version du site de la MG.Maniscalco.</p>
                  <p>J'esp&egrave;re qu'elle vous plaira...</p>
                  <p><br>
                    <img src="images/barre.gif" width="530" height="5"> 
                  </p>                  
                  </p>
                <p> N'h&eacute;sitez pas &agrave; me contacter pour me faire part de vos critiques ou autre...</p>
                  <p>Pour cela il suffit d'un clic sur cette icone <a href="mailto:Info@MG-Maniscalco.fr" target="mainFrame"><img src="images/email.gif" width="28" height="28" border="0"></a><br>
                  </p></td>
              </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
</table>
 
</body>
</html>
Merci d'avance pour votre aide.
Bonne journée à tous. @+