1
0
mirror of https://github.com/php/web-php.git synced 2026-03-24 07:12:16 +01:00
Files
archived-web-php/bin/projects_inc.php

33 lines
804 B
PHP

<?php
// harcoded xsl and xml names
// this XSL generates an array of values
$xsl_name = "projects_inc.xsl";
$xsl = implode("",file($xsl_name));
$xml_name = "../backend/projects.xml";
// we need to do a replacement so the entities in the xml will
// not be interpreted by sablotron
$xml = str_replace("&","&amp;",implode("", file($xml_name)));
if (!xslt_process($xsl, $xml, &$result)) {
Header("Status: 500 Server Error");
echo xslt_error();
echo "ERROR ".$php_error_msg;
exit;
} else {
echo $result;
/*
if ($fp = fopen("../include/projects.inc", "w")) {
fwrite($fp, $result);
flush();
fclose($fp);
if (file_exists("../include/projects.inc"))
echo "Success! created ../include/projects.inc";
} else {
echo "Error while saving ../include/projects.inc";
}
*/
}
?>