try php file paths; use another placeholder

svn path=/trunk/; revision=33489
This commit is contained in:
2016-06-12 22:12:37 +00:00
parent 979ab4eca2
commit cb9aac6b50
2 changed files with 14 additions and 2 deletions

View File

@@ -50,6 +50,9 @@ foreach ($days as &$day) { // calculate for each day
$output .= "<tr>";
// date
if ($date = '' ) {
$date = "Day " . $day;
}
$output .= "<td>" . $date . $desc . "</td>";
// breakfast ($r_b)
@@ -95,11 +98,20 @@ $output .= "<td><strong>Total VKP: " . $r_total . " €</strong></td></tr></tabl
//------------------------------------
function replace_page($temp, $content){
$vars = array('%RESULT%'=>$content);
$vars = array(':RESULT:'=>$content);
return str_replace(array_keys($vars), $vars, $temp);
}
echo 1;
$template = file_get_contents('/home/www/html/global/internal/pd-result.en.html', true);
echo 2;
$template = file_get_contents('/internal/pd-result.en.html', true);
echo 3;
$template = file_get_contents('/../internal/pd-result.en.html', true);
echo 4;
$template = file_get_contents('../internal/pd-result.en.html', true);
echo 5;
$template = file_get_contents('http://fsfe.org/internal/pd-result.en.html', true);
echo replace_page($template, $output);

View File

@@ -20,7 +20,7 @@
<body>
<h1>Result of calculated per diems</h1>
%RESULT%
:RESULT:
</body>