Bonjour,
Je me permet de poster ici car je ne sais pas trop où poster donc désolé si je me suis trompé de partie.
Alors ma situation est simple et compliquer a la fois : je suis en train de faire une refonte complète d'une base de donnée de nos clients pour note utilisation technique. Mais voila dans cette refonte j'ai pensé a stocké une grande partie des pages sur la base de donnée dans une table "corps" qui contient la syntaxe HTML,PHP,... pour que cette page s'affiche.
Hors la/les fonction(s) stocké dans la table ne s'exécute pas du tout.
Voici le code utilisé :
Pages Index.php (qui appel mon affichage)
Page Fonction.php (où toutes les fonctions sur stocker)
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- Appel de la gestion d'affichage du menu déroulant --> <script type="text/javascript" src="menu.js"></script> <!-- Ou copier le code ci-dessus dans les balises : --> <script type="text/javascript"> </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Document sans titre</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <?php include "Fonction.php"; ?> <body> <?php include "head.php"; ?> <table width="770" border="0" cellspacing="0" cellpadding="0" align="center" > <tr> <td align="center"> <div id="page"> <div id="top"> <?php include "menu.xhtml"; ?> </div> </div> </td> </tr> <tr> <td align="center"> <div id="page"> <div id="wrapper"> <div id="main"> <p1>Test</p> <p>Test2</p> <p><?php if (isset($_GET['page'])){ $page = $_GET['page']; $categ = $_GET['categ'];} appel($page,$categ); ?></p> <-- Fonction qui fonctionne pour afficher les infos stocker. <br /> <br /> </div> </div> </div> </td> </tr> <tr> <td align="center"><div id="page"> <div id="footer"><!--Pied de page --> <p id="footer"><?php include "include/Pied.inc" ?> </p> </div> </div> </td> </tr> </table> </div> </div> </body> </html>
Les info dans la DB :
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 // on se connecte à MySQL $db = mysql_connect($HOST, $USER, $PSW); // on seléctionne la base mysql_select_db($DB,$db); //------------------------------------------- PARTIE APPEL DES PAGES -------------------------------------------// //Appel de la pages demander //Affichage du résultat function appel($page,$categ) { $sql = "SELECT * FROM corps where `page`='$page' && `categorie`='$categ'"; $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); $data = mysql_fetch_array($req); echo '<p>'.$data['compo'].'</p>'; } //------------------------------------------- PARTIE GARAGE -------------------------------------------// //recherche de la version Qui ne s'exécute pas quand elle est appelé de la DB mais qui s'exécute quand elle est appelé d'une page php function RechercheS($ver) { //Affichage du résultat par Version $sql = "SELECT `id`, `NOM`,`TYPE`,`CLE_CPTA`, `SERIAL_CPTA`, `NUMEROS`,`VERSION`,`LIGNE` FROM `garage` WHERE NOM like '$ver%' order by `NOM`"; $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); $tbl = "garage"; $stat = $_SESSION['statut'] > "1"; // on fait une boucle qui va faire un tour pour chaque enregistrement while($data = mysql_fetch_array($req)) if ($_SESSION['statut'] > "1") { echo '<tr> <td width="10" align="center"><div align="CENTER" class="result2"> </div></td> <td width="20" align="center"><div align="CENTER" class="result2"><a href="delete.php?id='.$data['id'].'&tbl='.$tbl.'"><img src="im/supp.png" border="0"></a></div></td> <td width="20" align="center"><div align="CENTER" class="result2"><a href="EnregGGE.php?id='.$data['id'].'& tbl='.$tbl.'"><img src="im/edit.png" border="0"></a></div></td> <td width="140" align="center"><div align="CENTER" class="result2"><b> '.$data['NOM'].'</b></div></td> <td width="90" align="center"><div align="center" class="result2"> '.$data['TYPE'].'</div></td> <td width="260" align="center"><div align="center" class="result2"> '.$data['CLE_CPTA'].'</div></td> <td width="190" align="center"><div align="center" class="result2"> '.$data['SERIAL_CPTA'].'</div></td> <td width="80" align="center"><div align="center" class="result2"> '.$data['NUMEROS'].'</div></td> <td width="70" align="center"><div align="center" class="result2"><a href="DL/L'.$data['LIGNE'].'V'.$data['VERSION'].'.exe">'.$data['VERSION'].'</a></div></td> </tr>';} else { echo ' <td width="10" align="center"><div align="CENTER" class="result2"> </div></td> <td width="140" align="center"><div align="CENTER" class="result2"><b> '.$data['NOM'].'</b></div></td> <td width="90" align="center"><div align="center" class="result2"> '.$data['TYPE'].'</div></td> <td width="260" align="center"><div align="center" class="result2"> '.$data['CLE_CPTA'].'</div></td> <td width="190" align="center"><div align="center" class="result2"> '.$data['SERIAL_CPTA'].'</div></td> <td width="80" align="center"><div align="center" class="result2"> '.$data['NUMEROS'].'</div></td> <td width="70" align="center"><div align="center" class="result2"><a href="DL/L'.$data['LIGNE'].'V'.$data['VERSION'].'.exe">'.$data['VERSION'].'</a></div></td> </tr>';} }
j'espère être assez clair mais j'ai des doute donc n'hésitai pas a poser des question ou demander des précision je me ferai un plaisir d'y répondre.
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 id 1 page garage categorie nom compo <form method="post"> <table width="300px" align="center" style="left: 150px;" border="0"> <tr> <td><div align="center">Recherche par Nom : </div> <div align="center"><input class='inTxt' type="text" name='version' size=30 value=""></div></td> </tr> <td align="center"><input type="submit" id="bnt" name="bntRech" value="Rechercher"></td> </tr> </table> </form> <br> <table id="include" height="20" border="0" cellpadding="0" cellspacing="0" background="im/corps2.gif"> <tr> <td width="10" align="center"><div align="CENTER"> </div></td> <td width="20" align="center"><div align="CENTER"> </div></td> <td width="20" align="center"><div align="CENTER"> </div></td> <td width="140" align="center"><div align="center">Nom : </div></td> <td width="90" align="center"><div align="center">Type : </div></td> <td width="270" align="center"><div align="center">Clé Compta : </div></td> <td width="190" align="center"><div align="center">Clé Sérial : </div></td> <td width="80" align="center"><div align="center">Numéros : </div></td> <td width="70" align="center"><div align="center">Version : </div></td> </table> <table id="include" height="20" border="0" align="center" cellpadding="0" cellspacing="0" background="im/corps2.gif"> <?php if(isset($_POST['bntRech'])) {$ver = $_POST['version']; RechercheS($ver);}; <-- cette fonction ne se déclenche pas ?> </table>
Partager