Well, first I am trying to create a navigation menu that will show the info I want on the right side. That does not go well. This is the menu source:
<?php
$projects_menu = array();
$new_project = $_GET["new_project"];
$sax = xml_parser_create();
xml_parser_set_option($sax, XML_OPTION_CASE_FOLDING, false);
xml_parser_set_option($sax, XML_OPTION_SKIP_WHITE,true);
xml_set_element_handler($sax, 'sax_start','sax_end');
xml_set_character_data_handler($sax, 'sax_cdata');
xml_parse($sax, file_get_contents('projects/projects.xml'),true);
xml_parser_free($sax);
function sax_start($sax, $tag, $attr) {
global $projects_menu;
if ($tag == 'projects') {
//echo '<ul>';
} elseif ($tag == 'project') {
$projectcode = htmlspecialchars($attr['code']);
$projectname = htmlspecialchars($attr['name']);
//echo '<li>' . $projectname . '';
$projects_menu [] = array('code' => htmlspecialchars($attr['code']));
}
}
function sax_end($sax, $tag) {
if ($tag == 'projects') {
//echo '</ul>';
} elseif ($tag == 'project') {
//echo '</li>';
}
}
function sax_cdata($sax, $data) {
echo htmlspecialchars($data);
}
if ($new_project != ""){
?>Submitted<?
$projects_menu [] = array('code' => $new_project);
}
function update_menu($menu_data){
$your_data = "<projects>\n";
foreach( $menu_data as $menu_item)
{
$your_data = $your_data."<project>\n\t<code>".$menu_item['code']."</code>\n</project>\n";
}
$your_data = $your_data."</projects>";
// Open the file and erase the contents if any
$fp = fopen("projects/projects.xml", "w");
// Write the data to the file
fwrite($fp, $your_data);
// Close the file
fclose($fp);
}
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="91%">
<tr>
<td width="100%" height="100%" bgcolor="#E7EDF6" class="menu" valign="top">
<table cellpadding="1" cellspacing="0" border="0">
<?
foreach( $projects_menu as $menu_item)
{
?><tr><td width="18"><img src="images/icon_requests.gif"></td><td><a href="editproject.php?pid=<?=$menu_item['code']?>" target="mainFrame"><?=$menu_item['code']?></a></td></tr><?
}
?>
</table>
</td>
</tr>
</table>
</body>
</html>
This code shows the project code and name, though it is not presented as the link I want, so I must be missing something.