I'm not really sure if thats a PHP problem or im doing something else wrong. I'm trying to build a simple content management system. I've been following the example of a more complex CMS. Im currently working on a navigation page and a html form that should display the relavent content to be edited, depending on what is selected by the user in the navigation.
The problem is the form initially loads(with no data as it should) but i get a 'page not found error' from IE everytime i click something on the navigation menu. what it should do is take a variable value and reload the relavant data in the form again. It looks like the variable $subSection is not being set but it should and I dont know any others ways to set that on the fly.
Im using php4 with mysql 4 on windows 2000
any suggestions would be appreciated, thanks guys
code:
frIntroEdit.php
<?php
include ("manageHeader.php");
require_once("getData.inc.php");
?>
<? //require('lang.inc.php'); ?>
<!-- Start Sub Navigation Table -->
<? include ("frNavManage.php"); ?>
<!-- End Sub Navigation Table -->
<td> </td>
<td valign="top">
<!-- Start Content Table -->
<?php
echo "<form name=\"addEdit\" method=\"post\" action=\"updateIntro1.php\">\n" .
"<input type=\"hidden\" name=\"navSection\" value=\"$navSection\">\n";
if(!isset($navSection)){
echo "navSection has NOT been set";
}
$content = getContent($navSection);
if(!is_array($content)) $content = array();
?>
<input type="hidden" name="id_<?php echo '';?>" value="<?php echo $content['id']; ?>">
<div style="border: 1px solid #dddddd;padding:10px;margin-bottom:20px;width:100%;background:f6f6f6">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="heading"><?php echo $content['Title'] ?></td>
</tr>
<tr>
<td><img src="../images/spacer.gif" width="1" height="15"></td>
</tr>
<tr>
<td class="text">
Each paragraph must begin with <p> opening tag and finish with the </p> closing tag.
To bold text use the <b><b>bold</b></b> tags and to italicise text use the <i><i>italics</i></i> tags.
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="2" cellpadding="5" marginwidth="0" marginheight="0" class="text">
<tr>
<td class="text"><b>Title:</b></td>
</tr>
<tr>
<td><input type="Text" name="title_<?php echo 'noLang'; ?>" value="<?php echo $content['Title'] ?>" class="text" style="width:100%"></td>
</tr>
<tr>
<td class="text"><b>Copy:</b></td>
</tr>
<tr>
<td><textarea type="Textfield" name="copy_<?php echo 'nolang';?>" rows="15" class="text" style="width:100%"><?php echo $content['Column1'] ?></textarea></td>
</tr>
<?php if ($content['ImageLink']) {?>
<tr>
<td class="text"><b>Current image:</b> <?php echo $content['ImageLink'] ?></td>
</tr>
<tr>
<td><img src="../images/projects/<?php echo $content['ImageLink'] ?>"></td>
</tr>
<tr>
<td class="text"><b>Select a new image:</b></td>
</tr>
<tr>
<td>
<select name="image_<?php echo 'noLang'?>" size="1" class="text" style="width:100%">
<option selected="selected"><?php echo $content['ImageLink'] ?></option>
<? include("listImage.php"); ?>
<option value="">No image</option>
</select>
</td>
</tr>
<?} else {?>
<tr>
<td class="text"><b>Image:</b></td>
</tr>
<tr>
<td>
<select name="image_<?php echo $language['idx'] ?>" size="1" class="text" style="width:100%">
<option value="">Select an image:</option>
<? include("listImage.php"); ?>
</select>
</td>
</tr>
<?} ?>
<tr>
<td class="text">If you wish to upload a new image select "upload new image' from the menu on the left.</td>
</tr>
<tr>
<td class="text"><b>Image caption: (optional)</b></td>
</tr>
<tr>
<td><textarea type="Textfield" name="caption_<?php echo 'noLang';?>" rows="5" class="text" style="width:100%"><?php echo $content['caption'] ?></textarea></td>
</tr>
<tr>
<td><input type='Submit' name='submit' value='Update' class='text'></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
<!-- End Content Table -->
</td>
</tr>
<tr>
<td colspan="3"><img src="../images/spacer.gif" width="1" height="14"></td>
</tr>
</table>
</div>
</body>
</html>
frNavManage.php
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><img src="../images/nat_titleCountry.gif" width="211" height="61" /></td>
</tr>
<tr>
<td colspan="2"><img src="../images/spacer.gif" width="1" height="10" /></td>
</tr>
<tr>
<td valign="top" rowspan="10"><img src="../images/subNav_dots.gif" width="17" height="6" /></td>
<td><img src="../images/subNav_top.gif" width="185" height="6" /></td>
</tr>
<? if($navSection == "frhome") { ?>
<tr>
<td><a href="introEdit.php?navSection=frhome"><img src="subNav_home_on.gif" alt="frhome" name="frhome" width="185" height="27" border="0" class="alt" id="frhome"></a></td>
</tr>
<? } else { ?>
<tr>
<td><a href="introEdit.php?navSection=frhome" onMouseOver="MM_swapImage('frhome','','subNav_home_on.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="subNav_home_off.gif" alt="home" name="frhome" width="185" height="27" border="0" class="alt" id="frhome"></a></td>
</tr>
<? } ?>
<? if($navSection == 'frpower') { ?>
<tr>
<td><a href="introEdit.php?navSection=frpower"><img src="../images/subNav_rement_on.gif" alt="rement" name="frpower" width="185" height="27" border="0" class="alt" id="frpower"></a></td>
</tr>
<? } else { ?>
<tr>
<td><a href="introEdit.php?navSection=frpower" onMouseOver="MM_swapImage('frpower','','../images/subNav_rement_on.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="../images/subNav_rement_off.gif" alt="recruitment" name="repower" width="185" height="27" border="0" class="alt" id="frpower"></a></td>
</tr>
<? } ?>
<? if($navSection == 'froffice') { ?>
<tr>
<td><a href="introEdit.php?navSection=froffice"><img src="../images/subNav_about_on.gif" alt="about" name="about" width="185" height="27" border="0" class="alt" id="about"></a></td>
</tr>
<? } else { ?>
<tr>
<td><a href="introEdit.php?navSection=froffice" onMouseOver="MM_swapImage('about','','../images/subNav_about_on.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="../images/subNav_about_off.gif" alt="about" name="about" width="185" height="27" border="0" class="alt" id="about"></a></td>
</tr>
<? } ?>
<? if($navSection == 'fronoffshore') { ?>
<tr>
<td><a href="introEdit.php?navSection=fronoffshore"><img src="../images/subNav_industry_on.gif" alt="industry" name="industry" width="185" height="27" border="0" class="alt" id="industry"></a></td>
</tr>
<? } else { ?>
<tr>
<td><a href="introEdit.php?navSection=fronoffshore" onMouseOver="MM_swapImage('industry','','../images/subNav_industry_on.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="../images/subNav_industry_off.gif" alt="industry" name="industry" width="185" height="27" border="0" class="alt" id="industry"></a></td>
</tr>
<? } ?>
<tr>
<td><?php if ($navSection =="up"){?><a href="uploadImage.php?section=upload&lang=<?= $lang ?>"><img src="../images/subNav_upload_on.gif" alt="Upload New Image" name="upload" width="185" height="26" border="0" class="alt" id="upload" /></a><?} else { ?><a href="uploadImage.php?section=upload&lang=<?= $lang ?>" onMouseOver="MM_swapImage('upload','','../images/subNav_upload_on.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="../images/subNav_upload_off.gif" alt="Upload New Image" name="upload" width="185" height="26" border="0" class="alt" id="upload" /></a><? } ?></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="../images/subNav_dots.gif" width="17" height="6" /></td>
<td><img src="../images/subNav_bot.gif" width="185" height="6" /></td>
</tr>
</table>