nerd99 Posted May 19, 2010 Share Posted May 19, 2010 Hi All, Having some trouble with a page. I have created a dropdown menu navigation for my control panel pages. All links are working fine, just for one of them - MyStudents --> Submit Reports. I've spent hours trying to work this out so any fresh eyes would be a great help The error message I get appears to be within the linking navigation menu - i.e the page loads until the point where it has a problem (supposedly line 27 in tutor_links???) Here is the code... tutor_links.php <style media="all" type="style.css";</style> <div class="menu"> <ul> <li><a href="tutorcp" class="green">MyHome</a></li> <li><a href="tutor_details" target="_self" >MyDetails</a> <ul> <li><a href="tutor_change_password" target="_self">Change Password</a></li> <li><a href="tutor_edit_bio" target="_self">Edit Profile</a></li> </ul> </li> <li><a href="tutor_view_payments" class="green">MyPayments</a> <ul> <li><a href="tutor_invoice_new" target="_self">Create New Invoice</a></li> <li><a href="tutor_view_payments" target="_self">Outstanding</a></li> <li><a href="tutor_view_payments" target="_self">Paid</a></li> </ul> </li> <li><a href="tutor_calendar" class="green">MyCalendar</a> <ul> <li><a href="tutor_calendar" target="_self"> <?php $username = $_SESSION['username']; //Get calendar code from tutors table $result = mysqli_query($connection,"SELECT * FROM tutors WHERE username='$username'")or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { // Get all rows and assign them to variables $school = $row['school']; } echo $school; ?></a></li> </ul> <li><a href="tutor_timetable" class="green">MyTimetable</a></li> <li><a href="tutor_submit" class="green">MyStudents</a> <ul> <li><a href="tutor_submit_roll" target="_self">Submit Attendance</a></li> <li><a href="tutor_submit_report" target="_self">Submit Reports</a></li> </ul> </li> <li><?php if (!isset($_SESSION['tutor_is_logged_in'])) { echo "<li><a href='login' class='blue'>login</a></li>"; } else { echo "<li><a href='logout' class='logout'>logout</a></li>"; } ?> </li> </ul> </div> <!--- menu ---> tutor_submit_report.php <?php include('includes/tutor_session.php'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>Tutor Control Panel</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <!-- Inschool Logo and Horizontal Line image --> <div id="logo"></div> <?php include('tutor_links.php'); ?> <!-- Main Body --> <div id="cp_bg"> <div id=cp_body> <?php require_once("includes/connection.php"); ?> <whitehead>Submit Reports</whitehead> <form action="tutor_submit_report_process.php" method="post" name="tutor_submit_report"> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>STUDENT DETAILS</whitehead></td></tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr> <td align="left" width="150">Full Name:</td> <td><select name="full_name"> <?php $username = $_SESSION['username']; $result = mysqli_query($connection,"SELECT full_name FROM students WHERE tutor_1='$username'")or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { $full_name = $row['full_name']; echo "<option>" . $full_name . "</option>"; } ?> </select></td> </tr> <tr> <td align="left" width="150">Term:</td> <td><input name="term" type="text" size="1" maxlength="1" /></td> </tr> <td>Year:</td> <td><select name="year"><option>2010</option><option>2011</option><option>2012</option></select></td> <tr> <td>Instrument:</td> <td><select name="instrument"><option>Clarinet</option><option>Flute</option><option>Trumpet</option><option>Trombone</option><option> French Horn</option><option>Baritone</option><option>Tuba</option><option>Guitar</option><option>Bass Guitar</option><option>Percussion</option><option>Piano</option><option>Voice</option></select></td> </tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>GENERAL</whitehead></td></tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr> <td align="left" width="150">Is the student punctual?</td> <td><select name="q1"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student remember their music, notebook, instrument?</td> <td><select name="q2"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left">Does the student practice enough to make steady progress?</td> <td><select name="q3"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left">Does the student make a concerted effort to improve or focus on technical skills associated with his/her instrument?</td> <td><select name="q4"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student have the correct embouchure or hold the instrument correctly?</td> <td><select name="q5"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Can the student play loudly and softly or interpret dynamic markings appropriate to his/her skill level?</td> <td><select name="q6"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Can the student articulate notes correctly?</td> <td><select name="q7"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student demonstrate a good understanding of Rhythm appropriate to his/her skill level?</td> <td><select name="q8"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student listen well and acknowledge directions?</td> <td><select name="q9"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student demonstrate aural perception abilities appropriate to his/her skill level?</td> <td><select name="q10"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student demonstrate a good overall understanding of musical concepts (Pitch, Duration, Tone Colour, Texture, Structure) appropriate to his/her skill level?</td> <td><select name="q11"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student demonstrate a general aptitude for music and their chosen instrument?</td> <td><select name="q12"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>SCALES / TECHNIQUE</whitehead></td></tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr> <td align="left" width="150">Scale 1 Name</td> <td><input name="scale_1" type="text" size="20" maxlength="50" /></td> <td><select name="q13"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Scale 2 Name</td> <td><input name="scale_2" type="text" size="20" maxlength="50" /></td> <td><select name="q14"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Sight Reading:</td> <td><input name="sight_reading" type="text" size="20" maxlength="50" /></td> <td><select name="q15"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>REPORTOIRE</whitehead></td></tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr> <td align="left" width="150">Reportoire 1 Name:</td> <td><input name="rep_1" type="text" size="20" maxlength="50" /></td> <td><select name="q16"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Reportoire 2 Name:</td> <td><input name="rep_2" type="text" size="20" maxlength="50" /></td> <td><select name="q17"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Reportoire 3 Name:</td> <td><input name="rep_3" type="text" size="20" maxlength="50" /></td> <td><select name="q18"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>COMMENTS</whitehead></td></tr> <td><textarea name="comments" cols="50" rows="8"></textarea></td></tr> </table> <p align="center"><input name="Submit" type="submit" value="Submit" /></p> </form> </div></div> </body> </html> Here is a page with the links working... tutor_submit_roll.php <?php include('includes/tutor_session.php'); ?> <?php //Log page require_once("includes/connection.php"); $ip= $_SERVER['REMOTE_ADDR']; // Get ip $user = $_SESSION['username']; $page = $user . " submit Roll"; // Page name $b = time (); // Get time from server $timezone = (date_default_timezone_set("Australia/Sydney")); // Make time Sydney time. $time = date ("Y-m-d H:i:s,$b"); // Format the date mysqli_query($connection,"INSERT INTO log (ip, username, page, time) VALUES ('$ip', '$user', '$page', '$time')") or trigger_error("SQL", E_USER_ERROR); // End Log Page ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>Tutor Control Panel</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <!-- Inschool Logo and Horizontal Line image --> <div id="logo"></div> <?php include('tutor_links.php'); ?> <!-- Main Body --> <div id="cp_bg"> <div id=cp_body> <whitehead>Submit Attendance</whitehead> <p></p> <p>Please include the following abbreviations when noting reasons for absence:</p> <p>'NG' = Notice Given / 'NSN' = Not Sufficient Notice (Example, 'Week 2: NSN. Phone call received 40mins prior to lesson')</p> <p>Don't forget to attach your notes before submitting them!</p> <!-- begin roll form --> <form id="roll" name="roll" method="post" action="tutor_submit_roll_process.php"> <table width="550" border="0" cellpadding="0" class="stat" align="center"> <tr> <th width="150"><div align="center" >Student Name</div></th><th width="30"><div align="center"> </div></th><th width="30"><div align="center"> </div></th><th width="250"><div align="center">Reason for absence if known<br/>(otherwise leave as "Absent")</div></th><th><div align="center" >Attach Note</div></th></tr><tr> <?php include('includes/connection.php'); $result = mysqli_query($connection,"SELECT * FROM site_config") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { $week = $row['week']; $term = $row['term']; $year = $row['year']; } $result = mysqli_query($connection,"SELECT * FROM students WHERE tutor_1='$user'") or die(mysqli_error($connection)); $i=0; while($row = mysqli_fetch_array($result)) { $id = $row['id']; $i++; $first_name = $row['first_name']; $last_name = $row['last_name']; $school = $row['school']; echo "<td align='left'><p><strong>".$last_name . "</strong> " . $first_name ."</p></td>"; echo "<input type='hidden' name='tutor_name[$i]' value='$user' />"; echo "<input type='hidden' name='first_name[$i]' value='$first_name' />"; echo "<input type='hidden' name='last_name[$i]' value='$last_name' />"; echo "<input type='hidden' name='week[$i]' value='$week' />"; echo "<input type='hidden' name='term[$i]' value='$term' />"; echo "<input type='hidden' name='year[$i]' value='$year' />"; echo "<input type='hidden' name='school[$i]' value='$school' />"; echo "<input type='hidden' name='id[$i]' value='$id' />"; echo "<td><div align='center' width='20'>Yes <input name='attendance[$i]' type='radio' value='y' checked='checked'/></div></td>"; echo "<td><div align='center' width='20'>No <input name='attendance[$i]' type='radio' value='n' /></div></td>"; echo "<td><div align='center' width='250'><input type='text' name='note[$i]' value='Week $week: Absent' size='30' /></div></td>"; echo "<td><div align='center' width='250'><input type='checkbox' name='attached[$i]' value='1' /></div></td>"; echo "</td>"; echo "</tr>"; } ?> </table> <p> </p <p align="center"><input name="Submit" type="submit" value="Submit Roll" /></p> </form> <!-- End roll form --> </html> Many thanks Link to comment https://forums.phpfreaks.com/topic/202321-error-in-menu-links/ Share on other sites More sharing options...
Potatis Posted June 29, 2010 Share Posted June 29, 2010 Hi Nerd99, did you solve this? If not, I spotted this: Try changing <li><a href="tutor_submit_report" target="_self">Submit Reports</a></li> </ul> </li> <li> to <li><a href="tutor_submit_report" target="_self">Submit Reports</a></li> </ul> in tutor_links.php Link to comment https://forums.phpfreaks.com/topic/202321-error-in-menu-links/#findComment-1078691 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.