4images Forum & Community
General / Allgemeines => Programming => Topic started by: .Infecto on October 24, 2014, 08:22:47 PM
-
Hallo zusammen,
ich möchte mit PHP an einer bestimmten Stelle in einer HTML Datei schreiben.
Um genau zu sein zwischen:
<!-- MARKER START -->
<!-- MARKER ENDE -->
Hat jemand einen kleinen Codeschnipsel parat?
Ich habe alles versucht. Ich bekomme es nur hin am Anfang oder am Ende der Datei etwas zu schreiben.
LG
-
Hi!
wenn du z.b. das hier in der Details.php einfügst:
if ($user_info['user_level'] == GUEST){
$my_php = "You have no Access !<br>";
$my_php .= "Please Login:<br>";
$my_php .= "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">Login</a>";
}
else {
$my_php = "<b> Hello ".$user_info['user_name']."</b><br>";
$my_php .= "as such we register the text below in the 'lang/your language/main.php' <br>".$lang['example_text'];
}
//Here starts the lang register
$site_template->register_vars(array(
"content" => $my_php, // <-- It is important that the same name used as in PHP Code above (in this example "my_php")
"lang_custom_page_title" => $lang['custom_page_title'], // <-- Page Title
"lang_example_text" => $lang['example_text'] // <-- the "example_text" must still be registered in the "lang/your language/main.php"
));
kannst du mittels "{content}" in der details.html den Inhalt anzeigen lassen.
Das ganze hier ist ein Auszug von dem hier:
http://www.4homepages.de/forum/index.php?topic=28819.msg154776#msg154776
mfg Andi