Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Require menu.php issues
Old 11-26-2009, 03:22 PM Require menu.php issues
Skilled Talker

Posts: 97
Trades: 0
Im a little stuck with my navigation bar and the issue came when I added files in a different folder, my contact form in in a different directory from the rest of the site. When I added the code:

<?php
require("menu.php");
?>

to the contact/index.php I had a load of errors (cant remember what exactly) so I added menu.php to the /contact directory and now Im left with the menu expanded:

Please see the difference here www.electrifire.co.uk
www.electrifire.co.uk/contact
__________________

Please login or register to view this content. Registration is FREE
- Fire Alarms, Security and Electrical
electrifire is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-26-2009, 04:20 PM Re: Require menu.php issues
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
Maybe put the menu.php back where it was and use

<?php
require("../menu.php");
?>
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 11-26-2009, 05:01 PM Re: Require menu.php issues
Novice Talker

Posts: 11
Trades: 0
seems you have solved it already... Regards,
__________________
Wondering who Iam? Visit me and check my thoughts at
Please login or register to view this content. Registration is FREE

Want to earn cash? click the image below :
Please login or register to view this content. Registration is FREE

chieina is offline
Reply With Quote
View Public Profile
 
Old 11-27-2009, 12:22 PM Re: Require menu.php issues
Skilled Talker

Posts: 97
Trades: 0
I did try:

<?php
require("/menu.php");
?>

and

<?php
require("//menu.php");
?>

But no joy, the issue isn't fixed it works ok on the index.php and throughout the site but not in a different directory
__________________

Please login or register to view this content. Registration is FREE
- Fire Alarms, Security and Electrical
electrifire is offline
Reply With Quote
View Public Profile
 
Old 11-27-2009, 01:34 PM Re: Require menu.php issues
Knight13's Avatar
Defies a Status

Posts: 10,289
Name: Knight13
Location: Cleveland, Ohio
Trades: 0
I think this may work.

<?php require( $_SERVER['DOCUMENT_ROOT']."/menu.php"); ?>
Knight13 is offline
Reply With Quote
View Public Profile
 
Old 11-28-2009, 05:41 AM Re: Require menu.php issues
Skilled Talker

Posts: 97
Trades: 0
Unfortunately not, I edited the code as you said:

<?php require( $_SERVER['DOCUMENT_ROOT']."/menu.php"); ?>

But the menu is full expanded, but only in the 'contact' directory the rest of the site is in the public_html folder and the require menu.php works fine.

This is where the error is

http://www.electrifire.co.uk/contact/
__________________

Please login or register to view this content. Registration is FREE
- Fire Alarms, Security and Electrical
electrifire is offline
Reply With Quote
View Public Profile
 
Old 11-28-2009, 08:25 AM Re: Require menu.php issues
Knight13's Avatar
Defies a Status

Posts: 10,289
Name: Knight13
Location: Cleveland, Ohio
Trades: 0
Ok i took another look at your site, are you including any other files to the rest of your site that your not including to your contact folder?

It looks like their may be something wrong with your javascript on that page, is it possible that you are forgetting a include with javascript on it?

Sorry i am not really good at javascript because i do not use it that much.
Knight13 is offline
Reply With Quote
View Public Profile
 
Old 11-28-2009, 01:50 PM Re: Require menu.php issues
Skilled Talker

Posts: 97
Trades: 0
Thanks for trying to help further, Im not aware of any javascript on there. The only script I have on the site is google analytics, but why would that cause the menu to display fully expanded?
__________________

Please login or register to view this content. Registration is FREE
- Fire Alarms, Security and Electrical
electrifire is offline
Reply With Quote
View Public Profile
 
Old 11-28-2009, 02:34 PM Re: Require menu.php issues
Defies a Status

Posts: 1,606
Trades: 0
Your menu is JS based. I'm not sure why you are having the problem.
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 11-28-2009, 03:42 PM Re: Require menu.php issues
Skilled Talker

Posts: 97
Trades: 0
I wonder if I can lift the contact files out of the contact directory and see if it solves it - It had loads of errors when I did this so not sure what thats about. Anyway below is the code from menu.php this file works fine in the root but not in a different directory. Not sure if this will help but:

<?php
?>
<script language="JavaScript" type="text/javascript">
<!--//--><![CDATA[//><!--
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("sidenav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;

//--><!]]>
</script>
<ul class="slidedoormenu level1" id="sidenav">
<li class="folder"><a href="/">&raquo; Home</a>
<li class="folder"><a href="aboutus.php">&raquo; About Us</a>
<li class="folder">
<a href="">&raquo; Electrical</a>
<ul class="level2">
<li><a href="/electrical.php" class="submenu">Electrical</a></li>
<li><a href="/partp.php" class="submenu">Part P</a></li>
<li><a href="/17th.php" class="submenu">17th Edition</a></li>
<li><a href="/inspectionandtesting.php" class="submenu">Inspection & Testing</a></li>
</ul>
</li>
<li class="folder"> <a href="">&raquo; Fire Alarm</a>
<ul class="level2">
<li><a href="/domesticfire.php" class="submenu">Domestic</a></li>
<li><a href="/fire.php" class="submenu">Commercial</a></li>
</ul>
</li>
<li class="folder">
<a href="#">&raquo; Intruder</a>
<ul class="level2">
<li><a href="/domestic_intruder.php" class="submenu">Domestic</a></li>
<li><a href="/commercial_intruder.php" class="submenu">Commercial</a></li>
<li><a href="/intruder.php" class="submenu">Upgades</a></li>
<li><a href="/intruder.php" class="submenu">One Off Servicing</a></li>

</ul>
</li>
<li class="folder">
<a href="access.php">&raquo; Access Control</a>


</li>
<li class="folder">
<a href="/cctv.php">&raquo; CCTV</a></li>

<li class="folder">
<a href="">&raquo; Maintenance</a>
<ul class="level2">
<li><a href="/intruder_alarm_maintenance.php" class="submenu">Intruder Alarm</a></li>
<li><a href="/access_control_maintenance.php" class="submenu">Access Control</a></li>
<li><a href="/cctv_maintenance.php" class="submenu">CCTV</a></li>
<li><a href="/fire_alarm_maintenance.php" class="submenu">Fire Alarm</a></li>
</ul>
</li>


<li class="folder">
<a href="/blog">&raquo; Our Blog</a>
</li>
<li class="folder lastitem">
<a href="http://electrifire.co.uk/contact/index.php">&raquo; Contact Us</a>
</li>
</ul>
__________________

Please login or register to view this content. Registration is FREE
- Fire Alarms, Security and Electrical

Last edited by electrifire; 11-28-2009 at 04:03 PM..
electrifire is offline
Reply With Quote
View Public Profile
 
Old 11-28-2009, 04:47 PM Re: Require menu.php issues
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.candsdesign.co.uk/article.../php-includes/

to reference an include as a "root relative path" use an absolute URI to the file
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-28-2009, 05:51 PM Re: Require menu.php issues
Skilled Talker

Posts: 97
Trades: 0
thanks got it sorted now, I used a different contact form script
__________________

Please login or register to view this content. Registration is FREE
- Fire Alarms, Security and Electrical
electrifire is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Require menu.php issues
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.55809 seconds with 12 queries