simon551 Posted June 25, 2007 Share Posted June 25, 2007 Hi, I can't understand why this markup is making my page stop functioning. If I take it out, my javascript will fire, but if I leave it in, nothing. </div> <div id="menu"> <?php require_once('../includes/NewMenu.inc.php'); ?> </div> I don't know for sure this is a javascript or html or php problem... posting here because if I take out the <?php require_once()?> and just leave an empty <div></div> then my page works fine. I'm using dreamweaver which also tells me this is an overlapping or unenclosed tag. but eh? Quote Link to comment Share on other sites More sharing options...
chrisuk Posted June 25, 2007 Share Posted June 25, 2007 hmm perhaps the .inc.php is causing the problem? Try it with just a .php extension and lose the .inc Quote Link to comment Share on other sites More sharing options...
per1os Posted June 25, 2007 Share Posted June 25, 2007 *chuckles at dw* Anyhow the inc.php is not causing the problem the way it is setup is fine and works because the naming scheme lets you know what the file is. Leave that be. Instead post the code for NewMenu.inc.php and maybe even view the source of the page see if there are any errors being hidden. Quote Link to comment Share on other sites More sharing options...
simon551 Posted June 25, 2007 Author Share Posted June 25, 2007 The menu: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <!--//the functionality for the drop-down was provided here: http://www.alistapart.com/articles/horizdropdowns --><script type="text/javascript" src="../Scripts/mainmenu.js"></script> <style type="text/css"> /*@import "../Styles/layout.css";*/ @import "../Styles/menustyle.css"; </style> </head> <body> <p><img src="../Images/vtmlogo.png" width="151" height="75" hspace="2" vspace="0" /></p> <ul id="nav"> <li><a href="../../../org/userlogin/index.php">Home</a></li> <li><a href="../../../org/Clients/clientlist.php">Clients</a> <ul> <li><a href="../../../org/Clients/clientlist.php">Client List</a> <li><a href="../../../org/Contracts/contractsList_public.php">Contracts</a></li> <li><a href="#">Team</a></li> <li><a href="#">Offices</a></li> </ul> </li> <li><a href="../../../org/Employees/Employee_list_full.php">Employees</a> <ul> <li><a href="../../../org/Employees/Employee_list_full.php">Employee List</a> <li><a href="#">Org Chart</a></li> </ul> </li> <li><a href="#">Projects </a> <ul> <li><a href="../../../org/Projects/projects_allactive.php">All Projects</a></li> <li><a href="../../../org/Projects/projects_byClient.php">Projects by Client</a></li> <li><a href="#">project what</a></li> </ul> </li> <li><a href="../../../org/Timesheets/timesheet_redirect.php">Timesheets</a> <ul> <li><a href="../../../org/Timesheets/timesheet_main.php">New Timesheet </a></li> <li><a href="../../../org/Timesheets/timesheet_redirect.php">Review Timesheets </a></li> <li><a href="../../../org/Timesheets/timesheet_current.php">Current Timesheet</a></li> </ul> </li> <li><a href="../../../org/ExpenseReports/erMain_R.php">Expense Reports </a> <ul> <li><a href="../../../org/ExpenseReports/erMain_C.php">New Expense Report </a></li> <li><a href="../../../org/ExpenseReports/erMain_R.php">Review Expense Reports</a></li> <li><a href="../../../org/ExpenseReports/erDetails_C.php">Current Expense Report</a></li> <li><a href="../../../org/ExpenseReports/review_allexpenses.php">Review Expenses by Date</a></li> </ul> </li> </ul> <p></p> <ul> <li><a href="../../../org/forum/">Help and Support</a></li> </ul> </body> </html> No errors found. Quote Link to comment Share on other sites More sharing options...
simon551 Posted June 25, 2007 Author Share Posted June 25, 2007 I'm finding a whole bunch of unenclosed tags. That should fix the problem. thanks for your help! Quote Link to comment Share on other sites More sharing options...
TreeNode Posted June 25, 2007 Share Posted June 25, 2007 Be careful about sending 2 headers Quote Link to comment Share on other sites More sharing options...
simon551 Posted June 25, 2007 Author Share Posted June 25, 2007 oh. maybe that's the problem. so I need to strip the header from the included file? how would I do that? Quote Link to comment Share on other sites More sharing options...
per1os Posted June 25, 2007 Share Posted June 25, 2007 Yea, included files should not have the full out html like the file it is bbeing included to, that is where DW will screw you. <!--//the functionality for the drop-down was provided here: http://www.alistapart.com/articles/horizdropdowns --> <script type="text/javascript" src="../Scripts/mainmenu.js"></script> <style type="text/css"> /*@import "../Styles/layout.css";*/ @import "../Styles/menustyle.css"; </style> <p><img src="../Images/vtmlogo.png" width="151" height="75" hspace="2" vspace="0" /></p> <ul id="nav"> <li><a href="../../../org/userlogin/index.php">Home</a></li> <li><a href="../../../org/Clients/clientlist.php">Clients</a> <ul> <li><a href="../../../org/Clients/clientlist.php">Client List</a> <li><a href="../../../org/Contracts/contractsList_public.php">Contracts</a></li> <li><a href="#">Team</a></li> <li><a href="#">Offices</a></li> </ul> </li> <li><a href="../../../org/Employees/Employee_list_full.php">Employees</a> <ul> <li><a href="../../../org/Employees/Employee_list_full.php">Employee List</a> <li><a href="#">Org Chart</a></li> </ul> </li> <li><a href="#">Projects </a> <ul> <li><a href="../../../org/Projects/projects_allactive.php">All Projects</a></li> <li><a href="../../../org/Projects/projects_byClient.php">Projects by Client</a></li> <li><a href="#">project what</a></li> </ul> </li> <li><a href="../../../org/Timesheets/timesheet_redirect.php">Timesheets</a> <ul> <li><a href="../../../org/Timesheets/timesheet_main.php">New Timesheet </a></li> <li><a href="../../../org/Timesheets/timesheet_redirect.php">Review Timesheets </a></li> <li><a href="../../../org/Timesheets/timesheet_current.php">Current Timesheet</a></li> </ul> </li> <li><a href="../../../org/ExpenseReports/erMain_R.php">Expense Reports </a> <ul> <li><a href="../../../org/ExpenseReports/erMain_C.php">New Expense Report </a></li> <li><a href="../../../org/ExpenseReports/erMain_R.php">Review Expense Reports</a></li> <li><a href="../../../org/ExpenseReports/erDetails_C.php">Current Expense Report</a></li> <li><a href="../../../org/ExpenseReports/review_allexpenses.php">Review Expenses by Date</a></li> </ul> </li> </ul> <p></p> <ul> <li><a href="../../../org/forum/">Help and Support</a></li> </ul> Try that out, and see where it gets you, you may need to move the style/javascript into the <head> tag or the header.inc.php include. Quote Link to comment Share on other sites More sharing options...
simon551 Posted June 25, 2007 Author Share Posted June 25, 2007 that took care of the 'unenclosed tag' error in DW. Thanks a lot for all your help, Frost and TreeNode (awesome name btw) But it still won't fire my javascript further up in the page if I include the menu. argh. guess I'm off to the javascript forum Quote Link to comment Share on other sites More sharing options...
TreeNode Posted June 25, 2007 Share Posted June 25, 2007 It should work as long as you have only 1 javascript onload event. It's easier to just create a single onload javascript function and refer to that. Like someone said earlier, your include files shouldn't actually have headers themselves (unless you have exceptions in the php code to handle that situation). Quote Link to comment Share on other sites More sharing options...
simon551 Posted June 25, 2007 Author Share Posted June 25, 2007 It's easier to just create a single onload javascript function and refer to that hmmm. sounds like a good idea. I have these in 2 files: window.onload=writeCurrName; window.onload=startList; how would you refer to the onload if I got rid of these and instead just had one: window.onload=loadevent; function loadevent(){ writeCurrName; startList; } I tried this and it didn't work. Quote Link to comment Share on other sites More sharing options...
simon551 Posted June 25, 2007 Author Share Posted June 25, 2007 marking as solved because the PHP portion is now solved. I'll try to figure out the javascript outside this forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.