-
Je reprends un ancien site en utilisant PhpEcho. use rawsrc\PhpEcho\PhpEcho;
define('MISSING_TABLE', "<tr><td>Signe manquant</td></tr>");
$filenameZ = 'block/zodiacProperties/'.sprintf("%'.02d", $_SESSION['zodiac']).'.html';
$filenameC = 'block/chineseProperties/'.sprintf("%'.02d", $_SESSION['chinese']).'.html';
$filenameText = 'block/signTextes/'.sprintf("%'.02d", $_SESSION['zodiac']) . sprintf("%'.02d", $_SESSION['chinese']) . '.html';
$missingZ = empty($_SESSION['zodiac']) || !file_exists(DIR_ROOT.'view/'.$filenameZ);
$missingC = empty($_SESSION['chinese']) || !file_exists(DIR_ROOT.'view/'.$filenameC);
$missingTxt = !file_exists(DIR_ROOT.'view/'.$filenameText);
$page = new PhpEcho('layout/main.php');
$body = new PhpEcho('block/signs.php');
$signZ = $missingZ ?
MISSING_TABLE:
new PhpEcho($filenameZ);
$signC = $missingC ?
MISSING_TABLE:
new PhpEcho($filenameC);
$signText = $missingTxt ?
"<p class='errors'>Texte manquant</p>":
new PhpEcho($filenameText);
$body['zodiacTable'] = $signZ;
$body['chineseTable'] = $signC;
$body['signText'] = $signText;
// for next two lines pages are required in index.php and parameters are defined in relevant pages
$body['header'] = $header;
$body['menu'] = $menu;
$page['body'] = $body;
echo $page; |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Salut Remplace les extensions rawsrc |
Beta Was this translation helpful? Give feedback.
-
Salut, juste pour te dire en passant que t'as un souci de logique dans le code : tu utilises Tu devrais revoir complètement cette partie de code. @++ |
Beta Was this translation helpful? Give feedback.
-
Merci pour ces deux messages qui m'ont bien aidé. |
Beta Was this translation helpful? Give feedback.
Salut
euh tu sais que par défaut seuls les fichiers avec extension
.php
sont passés à la moulinette PHP.si tu veux y inclure le parsage des
.html
, il faut le demander explicitement au serveur web.Remplace les extensions
.html
par.php
et vois ce qui se passerawsrc