Exemple #1
0
function readXMLFile($file)
{
    $site = simplexml_load_file($file);
    // get the contents of the XML file
    // next: loop through all the projects
    foreach ($site->content->section as $section) {
        switch ((string) $section['section']) {
            case 'Projects':
                // we are reading the list of projects and need to generate a fieldset for each project in the list
                print "<form>";
                foreach ($section->project as $proj) {
                    print "<fieldset>";
                    print "Project Name: <input type='text' size='24' value='" . $proj['info'] . "'/> <br/> Client: <input type='text' size='24' value='" . $proj['client'] . "'/> <br/> Agency: <input type='text' size='32' value='" . $proj['agency'] . "'/> <br/> BG Image: <input type='text' size='32' value='" . $proj['image'] . "'/> <br/> Vimeo ID: <input type='text' size='12' value='" . $proj['video'] . "'/>";
                    print "</fieldset> <br/>";
                }
                print "</form>";
        }
    }
}
?>

</head>

<body>

<?php 
readXMLFile("artjail.xml");
?>

</body>
</html>
Exemple #2
0
        $h = fopen($file, "w");
        if (!$h) {
            die("Couldn't write to disk!<br>\n");
        }
        writeXMLFile($h);
        include "mail.php";
        foreach ($mail as $i) {
            $emailmangled = str_replace("@", " at ", $emailname);
            $emailmangled = str_replace(".", " dot ", $emailmangled);
            mail($i, "CS documentation annotated by {$authorname}", "Author: {$authorname}\n" . "E-Mail: {$emailmangled}\n" . "Topic:  {$theme}\n" . "File:   {$HTTP_REFERER}\n" . "Time:   " . gmstrftime("%a, %d %b %G (%H:%M UTC)", $newentry->date) . " (" . $newentry->date . ")\n" . "Comment:\n" . stripslashes($texttext));
        }
        fclose($h);
        chmod($file, 0666);
        print "<h3>Comment added!</h3>\n";
        unset($entries);
        readXMLFile($file);
    }
    printEntries();
    print "<a href=\"{$self}?action=showadd#comments\">Add a comment</a><br>\n";
}
class entry
{
    var $author;
    var $email;
    var $text;
    var $date;
    var $addr;
    var $agent;
    function entry()
    {
        $this->author = "";