Inclure une page

Résolu/Fermé
samghami Messages postés 61 Date d'inscription mercredi 21 mars 2012 Statut Membre Dernière intervention 2 mars 2016 - 18 juin 2012 à 14:09
 AlainR - 3 févr. 2014 à 17:36
Bonjour, je n'arrive pas a inclure la page "statue.php"
Voici mon code :

<?php
$template = <<<THEVERYENDOFYOU
<div align="center"><div  style="width:auto; height:40px;position:static; background-color:rgb(59,89,152);margin-left:-10px;margin-right:-8px;margin-top:-10px;box-shadow: 1px 1px 1px 1px black;">
  <div align="center" style="width:1000px">
    <table width="100%" border="0">
      <tr>
        <td width="333px"><a href="dynabook.php"><img  style="margin-left:100px" src="././images/dynabook/logo.gif" width="150" height="35" /></a></td>
        <td width="333px" align="center"><form method="POST" action="dynabook.php?do=src"><input type="search" name="src" id="src" required/></form></td>
        <td width="333px" align="right"><div style="margin-right:25px"><a href="login.php?do=logout">Deconnexion</a></div></td>
      </tr>
    </table>
  </div></div><table width="100%" border="0">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

<div style="width:1000px"><p><p><p><p><p><p><p><p><p><p><p><p>
  <br />

<table width="999x">
<tr>
<td width="333px"><div align="center"><table ><tr><td class="title" width="300px"><img src="images/button_character.gif" alt="Personnage" title="Personnage" /></td></tr>
<tr><td>
<b>{{charname}}</b><br /><br />
<img src="././images/avatar/num-{{avatar}}.gif" width="71" height="66"><br /><br />

Difficulté: {{difficulty}}<br />
Classe: {{charclass}}<br /><br />

Niveau: {{level}}<br />
Experience: {{experience}} {{plusexp}}<br />
Prochain niveau: {{nextlevel}}<br />
Gils: {{gold}} {{plusgold}}<br />
Points hit: {{currenthp}} / {{maxhp}}<br />
Points de magies: {{currentmp}} / {{maxmp}}<br />
Points de voyages: {{currenttp}} / {{maxtp}}<br /><br />

Force: {{strength}}<br />
Dextérité: {{dexterity}}<br />
Pouvoir d'attaque: {{attackpower}}<br />
Pouvoir de défense: {{defensepower}}<br />
</td></tr>
</table><br />
<table>
<tr><td class="title" width="300px"><img src="images/button_inventory.gif" alt="Inventaire" title="Inventaire" /> </td></tr><tr><td> 
<table width="300px">
<tr><td><img src="images/icon_weapon.gif" alt="Arme" title="Weapon" /></td><td>Arme: {{weaponname}}</td></tr>
<tr><td><img src="images/icon_armor.gif" alt="Armure" title="Armor" /></td><td>Armure: {{armorname}}</td></tr>
<tr><td><img src="images/icon_shield.gif" alt="Protection" title="Shield" /></td><td>Protection: {{shieldname}}</td></tr>
</table>
Fente 1: {{slot1name}}<br />
Fente 2: {{slot2name}}<br />
Fente 3: {{slot3name}}
</td></tr>
</table>
<table width="300px">
<tr><td class="title"><img src="images/button_spells.gif" alt="Sorts" title="Spells" /></td></tr>
<tr><td>
{{magiclist}}
</td></tr>
</table>

</div> </td>
<td width="666px"><div align="center"><form method="POST" action="dynabook.php?do=profilif&id={{id}}">
  <input name="statue" type="text" id="statue" value="" size="100" required/>
</form></div>
<div align="center"> .include('statue.php');.
</div>  </td>
</tr>
</table>
<br />

<table width="333px">
<tr>
</tr>
</table>
<br /></div></div>

THEVERYENDOFYOU;
?>


Malheureusement ça ne fonctionne pas :/
Pouvez-vous m'aidez?

A voir également:

2 réponses

mpmp93 Messages postés 6652 Date d'inscription mercredi 13 avril 2011 Statut Membre Dernière intervention 28 septembre 2015 1 339
18 juin 2012 à 14:19
Bonjour,

Virez votre notation heredoc:

<?php
$template = <<<THEVERYENDOFYOU


et

THEVERYENDOFYOU;
?>


et à mon avis ça marchera.

A+

0
samghami Messages postés 61 Date d'inscription mercredi 21 mars 2012 Statut Membre Dernière intervention 2 mars 2016 1
18 juin 2012 à 14:49
Je ne peux pas, c'est pour mon system de template
0
mpmp93 Messages postés 6652 Date d'inscription mercredi 13 avril 2011 Statut Membre Dernière intervention 28 septembre 2015 1 339
Modifié par mpmp93 le 18/06/2012 à 16:17
1) faites ce que je dis

2) remplacez ceci:

<div align="center"> .include('statue.php');. </div> 

par celà:

<div style="text-align: center"><?php include 'statue.php'; ?></div>


et ça marchera
0
samghami Messages postés 61 Date d'inscription mercredi 21 mars 2012 Statut Membre Dernière intervention 2 mars 2016 1
18 juin 2012 à 17:40
Cela n'a pas fonctionné mais je suis passé pas une autre option est cela fonctionne je te remercie
0
Bonsoir.

Est-il possible de connaître la solution utilisée?
Cdt.
0