| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/(Del)therainbows.org.hk/webadmin/ |
Upload File : |
<?php
require("configure.php");
?>
<?php
$header = "<?xml version='1.0' encoding='utf-8'?>\n<playlist version='1' xmlns='http://xspf.org/ns/0/'>";
$nodeStart = "<trackList>\n";
$nodeEnd = "</trackList>\n</playlist>\n";
?>
<?php
function write_beg($filename, $header, $nodeStart, $data, $nodeEnd)
{
//Imports old data
$handle = fopen($filename, "r");
$old_content = fread($handle, filesize ($filename));
$f[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
$f[] = "<content>";
$f[] = "</content>";
foreach($f as $key => $value)
{
$old_content = trim(str_replace($value, "", $old_content));
}
fclose($handle);
//Sets up new data
$final_content = $header.$nodeStart.$data.$old_content.$nodeEnd;
//Writes new data
$handle2 = fopen($filename, "w");
$finalwrite = fwrite($handle2, $final_content);
fclose($handle2);
}
?>
<?php
$filename = "../slideshow/index.xml"; // File which holds all data
unlink($filename);
$sql = "select * from slide2 order by slide2id DESC";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
$data .= "<track>\n<title>". $row{'slide2title'} ." </title>\n<creator>rainbow mission</creator>\n<location>../webadmin/slide2/". $row{'slide2image'} ."</location>\n<info> </info>\n</track>\n";
}
write_beg($filename, $header, $nodeStart, $data, $nodeEnd);
?>