Ich habe mir eine Seite gecodet und wollte diese nun Online stellen, aber ich bekomm nun immer so einen fehler:
Der Inhalt der start.php
Die template.php
In der Database ist eine Tabelle (config) und da ist der Pfad zu den Templates gespeichert:
Könnt ihr mir weiterhelfen ?
Warning: fopen(): Unable to access start.html in /home/www/web28/html/dat/include/sites/start.php on line 2
Warning: fopen(start.html): failed to open stream: No such file or directory in /home/www/web28/html/dat/include/sites/start.php on line 2
Warning: feof(): supplied argument is not a valid stream resource in /home/www/web28/html/dat/include/functions/template.php on line 51
Warning: fread(): supplied argument is not a valid stream resource in /home/www/web28/html/dat/include/functions/template.php on line 52
Warning: feof(): supplied argument is not a valid stream resource in /home/www/web28/html/dat/include/functions/template.php on line 51
Warning: fread(): supplied argument is not a valid stream resource in /home/www/web28/html/dat/include/functions/template.php on line 52
Warning: fopen(start.html): failed to open stream: No such file or directory in /home/www/web28/html/dat/include/sites/start.php on line 2
Warning: feof(): supplied argument is not a valid stream resource in /home/www/web28/html/dat/include/functions/template.php on line 51
Warning: fread(): supplied argument is not a valid stream resource in /home/www/web28/html/dat/include/functions/template.php on line 52
Warning: feof(): supplied argument is not a valid stream resource in /home/www/web28/html/dat/include/functions/template.php on line 51
Warning: fread(): supplied argument is not a valid stream resource in /home/www/web28/html/dat/include/functions/template.php on line 52
PHP-Code:
<?php
$file = fopen($config["templatedir"]."start.html", "r");
if (!$file) {
$text = "Startseitentext existiert nicht.";
}else {
$text = "";
$array = array(
"'{VALUTA}'",
"'{STARTAMOUNT}'"
);
$replace = array(
$config["valuta"],
$config["lose_for_register"]
);
while(!feof($file)) {
$text .= preg_replace($array, $replace, fread($file, 1024));
}
}
?>
PHP-Code:
<?php
$array = Array();
$replace = Array();
if (isset($template) && is_array($template)) {
while(list($key, $val) = each($template)) {
array_unshift($array, "'{".$key."}'");
array_unshift($replace, $val);
}
}
array_unshift($array, "'{ERROR}'");
array_unshift($replace, $error);
if (!isset($script)) {
$script = "";
}
if (!isset($loadtime)) {
$loadtime = "";
}
if (!isset($statistik)) {
$statistik = "";
}
array_unshift($array, "'{SCRIPT}'");
array_unshift($replace, $script);
array_unshift($array, "'{LOADTIME}'");
array_unshift($replace, $loadtime);
array_unshift($array, "'{STATISTIK}'");
array_unshift($replace, $statistik);
if (!isset($config["title"])) {
$config["title"] = "";
}
array_unshift($array, "'{TITLE}'");
array_unshift($replace, $config["title"]);
$file = fopen($config["templatedir"].$config["template"], "r");
if (!isset($script)) {
$script = "";
}
while(!feof($file)) {
$tpl = preg_replace($array, $replace, fread($file, 1024));
print $tpl;
}
?>
name
templatedir
value
templates/
templatedir
value
templates/
Könnt ihr mir weiterhelfen ?
Kommentar