please the id = addpage is overflowing, below is the mark up and cssCode PHP:<?php require_once("include/connection.php"); ?> <?php require_once("include/functions.php"); ?> <?php if (intval($_GET['subj']) == 0) { redirect_to("contents.php"); } include_once("include/form_functions.php"); // start form processing // only execute the form processing if the form has been submitted if (isset($_POST['submit'])) { $errors = array(); // form validation: initialise an array to hold our errors $required_fields = array('menu_name', 'position', 'visible'); $errors = array_merge($errors, check_required_fields(required_fields)); $fields_with_lenghts = array('menu_name' => 30); $errors = array_merge($errors, check_max_field_lenghts($fields_with_lenghts)); //update $id = mysql_prep($_GET['subj']); $menu_name = mysql_prep($_POST['menu_name']); $position = mysql_prep($_POST['position']); $visible = mysql_prep($_POST['visible']); if (empty($errors)) { $query = "UPDATE subjects SET menu_name = '{$menu_name}', position = {$position}, visible = {$visible} WHERE id = {$id}"; $result = mysql_query($query, $connection); if (mysql_affected_rows() == 1) { // Success $message = "The subject was succesfully updated. "; } else { //failed $message = "The subject was not succesfully updated. "; $message .= "<br />". mysql_error(); } }else{ //error occured $message = "There were " . count($errors) . " errors in the form."; } } // end of if (isset($_POST['submit'])) ?> <?php find_selectedpage(); ?> <?php include("include/header.php"); ?> <div id="navigation"> <?php echo navigation($select_subject, $select_page); ?> </div> <!--end of navigation div --> <div id="bodycontent"> <h2>Edit Subject: <?php echo $select_subject['menu_name'];?></h2> <?php if (!empty($message)) { echo "<p class=\"message\">" . $message . "</p>"; } ?> <?php // output a list of the fields that had errors if (!empty($errors)) { echo "<p class=\"errors\">"; echo "Please review the following fields:<br />"; foreach($errors as $error) { echo " - " . $error . "<br />"; } echo "</p>"; } ?> <form action="edit_subject.php?subj=<?php echo urlencode( $select_subject['id']); ?> " method="post"> <p>Subject name: <input type="text" name="menu_name" value="<?php echo $select_subject['menu_name'];?>" id="menu_name" /> </p> <p>Position: <select name="position"> <?php $subject_set = get_all_subjects(); $subject_count = mysql_num_rows($subject_set); //$count+1 bcos we are adding a subject for($count=1; $count <= $subject_count+1; $count++) { echo "<option value=\"{$count}\""; if ($select_subject['position'] == $count) { echo " selected"; } echo ">{$count}</options>"; } ?> </select> </p> <p>Visible: <input type="radio" name="visible" value="0"<?php if ($select_subject['visible'] == 0) {echo " checked";} ?> /> No <input type="radio" name="visible" value="1"<?php if ($select_subject['visible'] == 1) {echo " checked";} ?> />yes </p> <input type="submit" name="submit" value="Edit Subject" /> <a href="delete_subject.php?subj=<?php echo urlencode($select_subject['id']); ?>" onclick="return confirm('Are you sure?');"> Delete Subject</a> </form> <br /> <a href="contents.php">Cancel</a> [COLOR="purple"]<div id="addpage"> <h3>Pages in this subject:</h3> <ul> <?php $subject_pages = get_pages_for_subject($select_subject['id']); while($page = mysql_fetch_array($subject_pages)) { echo "<li><a href=\"contents.php?page={$page['id']}\"> {$page['menu_name']}</a></li>"; } ?> </ul> <br /> + <a href="new_page.php?subj=<?php echo $select_subject['id']; ?> ">Add a new page to this subject</a> </div> [/COLOR]</div> <?php require("include/footer.php"); ?>
and the css
Code CSS:/* CSS for Reacheasy site */ body,html { margin: 0; } #page { width: 1060px; margin: 0 auto; position: relative /* is the same as: margin-top: 0; margin-bottom: 0; margin-left: auto; margin-right: auto; */ } /* sticky footer */ /*Opera Fix*/ body:before { content:""; height:100%; float:left; width:0; margin-top:-32767px; } #outer:after { clear:both; display:block; height:1%; content:" "; } /* ... */ /* CSS for Reacheasy site */ html, body { height:100%; margin:0; padding:0; border:none; background: url("img/aurora.jpg"); } #outer { width:1060px; margin:auto; min-height:100%; margin-top:-52px; border-left:1px solid black; border-right:1px solid black; background: #A1A1A1 url(backgrounds/nav-bg.jpg) repeat-y left top } * html #outer { height:100% } h1 { font-size: xx-large; color: white; padding: 2em 0 .2em .4em; margin: 0; background: url(img/header.jpg) repeat-y right; } h2 { font-size: x-large; color: white; padding: 2em 0 .2em .4em; margin: 0; } p { font-size:large; color: white; padding: 1em 0 .1em .2em; margin: 0; } ul#nav { height: 2em; list-style: none; margin: 0; padding: .2em 0; margin:0; background: url(img/tabs.gif); } ul#nav li { background: #48f url(img/tabs.gif); float: left; margin: 0 1px 0 0; padding-left: 10px; border-right: 1px solid #A1A1A1; } ul#nav a { background: url(img/tabs.gif) 100% 0; color: #008; display: block; float: left; height: 2em; line-height: 2em; padding-right: 10px; text-decoration: none; } ul#nav li.current { background-color: #48f; background-position: 0 -60px; } ul#nav li.current a { background-position: 100% -60px; color: #fff; font-weight: bold; } #navigation { width: 180px; float:left; } #navigation li { margin: 0 1px 0 0; padding-left: 0px; text-decoration: none; list-style: none; } #navigation a { color: #008; padding-right: 10px; text-decoration: none; } #navigation a:visited{ color: #008; } #navigation p { font-size:xx-small; color: white; padding: 1em 0 .1em .2em; margin: 0; } #navigation ul.pages { padding-left: 2em; list-style: square; } #bodycontent { float:right; width:880px; background:black; height:390px; } #header { width:100%; border-top:52px solid #fff; border-bottom:1px solid #A1A1A1; } #footer { width:1060px; clear:both; height:50px; border-top:1px solid #000; background-color:#fff; border-bottom:1px solid #000; color: #000000; text-align:center; margin:0 auto; } ul#footlink { padding: 0px; margin: 0px; list-style-type: none; float: left; width: 100%; color: #fff; } ul#footlink li { display: inline; text-align:center; } #bannercontainer{ width: 800px; height: 400px; padding: 0; margin-left: auto; margin-right: auto; background: #eee; border: 1px solid #000; } #bannercontainer a{ display: block; width: 800px; height: 400px; padding: 0; background:#eee url(img/pr.jpg) 0 0 no-repeat; } #bannercontainer a:link,#bannercontainer a:visited{ background:#eee url(img/pr.jpg) 0 0 no-repeat; } #bannercontainer a:hover{ background:#eee url(img/pr.jpg) 150px 0 no-repeat; } #promo-banners{ width:860px; } .promo-banner{ border: medium none; display:block; float: left; padding: 0 19px 5px 0; width: 230px; } .promo-seo{ color:white; display:block; float:left; font:12px arial; height:75px; margin-bottom:5px; padding:7px 5px 0; text-align:left!important; width:218px; } .promo-seo-link{ color:#bdbdbd; text-decoration:none; } .promo-seo-link:visited{ color:#bdbdbd; } [COLOR="Purple"]#addpage { margin-top: 2em; border-top:1px solid white;[/COLOR] }



Reply With Quote



Bookmarks