PHP Include dosent work :(

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Post Reply
Leon
Know-It-All
Know-It-All
Posts: 282
Joined: Tue Feb 07, 2006 11:09 am
Contact:

I gona have a drop down menu when im done whit it..

The problem is that i gona have 3 menus.
One for non logged in
one english logged in
one swedish logged in

So ofcourse i create 3 folders here is 2:
English
Swedish

I want to have them in folders because it gets alot more easier
to seperate them and update each one if i have too..

The menu as it gona look when its done (As you can see its the whole header i gona change :) )
Demo 1 (Done?)

So i created a temporary file one folder down from the menu files:
TESTPAGE

In the menu folder i created a tpl file whit the code i got from the menu builder to put on the acually page:

Code: Select all

<HTML>
<BODY>
<center>


<table border=0 cellpadding=0 cellspacing=0><tr><td><script language="javascript" src="sfengarrays.js"></script>
<script language="javascript">
var HOPBn=false;uagent = window.navigator.userAgent.toLowerCase();HOPBn=(uagent.indexOf('opera') != -1)?true:false;
if(document.all){if(HOPBn==true){	document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenuengopera.js\"></scr"+"ipt>");document.write('<div id="enghmplcmenu1" style="position:relative;width:485px;height:22px;background:#000000;padding:0px;overflow:hidden;border-width:0px;"></div>');}
else{	document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenuengie.js\"></scr"+"ipt>");document.write('<div id="enghmplcmenu1" style="position:relative;width:485px;height:22px;background:#000000;padding:0px;overflow:hidden;border-width:0px;"></div>');}}
else{if(document.layers){	document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenuengns4.js\"></scr"+"ipt>");document.writeln('<table><tr><td width=485>');document.writeln('<ilayer id="enghmplcmenu1" width=485 height=0 bgcolor="#1D4496"></ilayer>');document.writeln('</td></tr></table>');}
else{	document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenuengns.js\"></scr"+"ipt>");}}
</script></td></tr></table>


</center>
</BODY>
</HTML>
As you can see it works when you open the tpl file:
blue.tpl


In the testpage i created 1 folder down i included the tpl file whit this code

Code: Select all

<?php include 'http://www.volunteerforum.se/Minmapp/Portalen/meny/testblue/blue.tpl'?>
But it dosent work as you can see here, i cant see the menu:
TESTPAGE

Any idé how i could fix this problem :?:
Talk, discuss or debate everything about Volunteer 'ing at this forum!
Volunteer Forum Community
Leon
Know-It-All
Know-It-All
Posts: 282
Joined: Tue Feb 07, 2006 11:09 am
Contact:

Its like the same problem as when i just include the menu code in another folder then where the files is in...

Like this if i create a file test.php one folder down from the menu or any other folder for that sake and include the code i got from the menu builder:

Code: Select all

<HTML> 
<BODY> 
<center> 


<table border=0 cellpadding=0 cellspacing=0><tr><td><script language="javascript" src="sfengarrays.js"></script> 
<script language="javascript"> 
var HOPBn=false;uagent = window.navigator.userAgent.toLowerCase();HOPBn=(uagent.indexOf('opera') != -1)?true:false; 
if(document.all){if(HOPBn==true){   document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenuengopera.js\"></scr"+"ipt>");document.write('<div id="enghmplcmenu1" style="position:relative;width:485px;height:22px;background:#000000;padding:0px;overflow:hidden;border-width:0px;"></div>');} 
else{   document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenuengie.js\"></scr"+"ipt>");document.write('<div id="enghmplcmenu1" style="position:relative;width:485px;height:22px;background:#000000;padding:0px;overflow:hidden;border-width:0px;"></div>');}} 
else{if(document.layers){   document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenuengns4.js\"></scr"+"ipt>");document.writeln('<table><tr><td width=485>');document.writeln('<ilayer id="enghmplcmenu1" width=485 height=0 bgcolor="#1D4496"></ilayer>');document.writeln('</td></tr></table>');} 
else{   document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenuengns.js\"></scr"+"ipt>");}} 
</script></td></tr></table> 


</center> 
</BODY> 
</HTML>
The same problem happens...

I suppose thats because when using the include,
it dosent include it "as a file"
But it includes all the code in that file..
Talk, discuss or debate everything about Volunteer 'ing at this forum!
Volunteer Forum Community
Burian
A Forum Addict
A Forum Addict
Posts: 59
Joined: Sat Nov 05, 2005 3:50 am
Contact:

you are missing a ; at the end of the include use this instead
Burian
http://cool-downloads.uni.cc

BurianBB Forum Development

Image
Leon
Know-It-All
Know-It-All
Posts: 282
Joined: Tue Feb 07, 2006 11:09 am
Contact:

Well it worked whiout the tag, but i put it there and it still the same problem..


The problem is that the include funtion only generates the code from the tpl file that is in the menu folder on the testpage..

And that code want the menu files to be in the same foldes as the site
you are loading in this case the testfile folder is one under the acually
menu folder..
Talk, discuss or debate everything about Volunteer 'ing at this forum!
Volunteer Forum Community
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Most of it is in javascript, so I don't really know what I am looking for.

If you are just looking for a simple menu though, I suggest a dropdown menu:

Code: Select all

<select name="menu">
<option value="english">English</option>
<option value="swedish">Swedish</option>
</select>
Within a <form> tag.
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
Leon
Know-It-All
Know-It-All
Posts: 282
Joined: Tue Feb 07, 2006 11:09 am
Contact:

No, that looks crazy then, really unprofessional..

This is hows it gona look when it is complete:
http://www.volunteerforum.se/Minmapp/Po ... /blue2.php
(This example is fully working)


I could put all menu files in the root, but i dont want to
have so many files in the root, thats the thing..
Talk, discuss or debate everything about Volunteer 'ing at this forum!
Volunteer Forum Community
Post Reply