Thank you for the reply.
I did not see that. everything was already enabled for PHP to work, in static pages.
I changed the tags to be reverse, just as the document descripes. The example works.
I am still the following error. Perhaps, the function is not correctly formated?
Parse error: syntax error, unexpected $end in /mounted-storage/home71b/sub005/sc41175-ZRMB/grevepigerne.dk/geeklog/plugins/staticpages/functions.inc(841) : eval()'d code on line 110
Text Formatted Code
?>
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<html>
<head>
<title>XML Playlist Maker</title>
</head>
<body bgcolor="#000000" text="#ffffff" vlink="#ffff00" alink="#0000ff" link="#993300">
<?php
if ($submit)
{
//Change the value of below var to the location you want the file saved to
//Remember to add the trailing / (slash)
$outpath = "/mounted-storage/home71b/sub005/sc41175-ZRMB/galleries/playlists/grevepigerne/playlists/";
//This array keeps the list of "items" to change in the template file.
$template_vars = array (
"NAME" => $NAME,
"TITLE" => $TITLE,
"CREATOR" => $CREATOR,
"LOCATION" => $LOCATION,
);
$fp = fopen("/mounted-storage/home71b/sub005/sc41175-ZRMB/grevepigerne.dk/geeklog/public_html/configurator/xml-template-12.xml", "rb");
$template = fread($fp, filesize("/mounted-storage/home71b/sub005/sc41175-ZRMB/grevepigerne.dk/geeklog/public_html/configurator/xml-template-12.xml"));
fclose($fp);
$template = DoReplace($template, $template_vars);
$outfile = $NAME.".xml";
$fp = fopen($outpath.$outfile, "wb");
fwrite($fp, $template);
fclose($fp);
print("File saved as: ".$outpath.$outfile."<BR>\n");
print("<A HREF=\"".$PHP_SELF."\">Make another</A><BR><BR>");
print("<CODE>".nl2br($template)."</CODE>\n");
}
else
{
?>
<h1 align="center">XML Playlist Creator 12</h1>
<h3 align="center"> </h3>
<table align="center" border="0" width="82%">
<tr>
<td width="100%" align="middle">
<h6 align="left"><b><font size="2">
The page will create a XML
page with 12 entrries in the list and save the file in
galleries/playlists/grevepigerne/playlists.</font></b></h6>
</td>
</tr>
</table>
<form action="print($PHP_SELF) ?submit=yes" method="post">
<table>
<tr height="69">
<td><b><font size="2">Playlist Name: "Competition:"</font></b></td>
<td><input name="NAME" style="WIDTH: 515px; HEIGHT: 22px" size="66"></td>
</tr>
</table>
<br>
<br>
<br>
<table>
<tr height="30">
<td><b><font size="2">Camera :</font></b></td>
<td><input name="TITLE" value="Søren" style="WIDTH: 515px; HEIGHT: 22px" size="66"></td>
</tr>
<tr height="30">
<td><b><font size="2">Description :</font></b></td>
<td><input name="CREATOR" style="WIDTH: 515px; HEIGHT: 22px" size="66"></td>
</tr>
<tr height="30">
<td><b><font size="2">Filename (no extention)
:
</font></b></td>
<td><input name="LOCATION" style="WIDTH: 515px; HEIGHT: 22px" size="66"></td>
</tr>
</table>
<br>
<br>
<br>
<table>
<tr>
<td><input type="submit" value="Generate .CFG"></td>
<td><input type="reset" value="Clear form"></td>
</tr>
</table>
</form>
</body>
</html>
<?php
function DoReplace($string, $array)
{
foreach ($array AS $key => $value)
{
$string = str_replace("{".$key."}", $value, $string);
}
return $string;
}