Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Wednesday July 18 2012 - 06:07:36

Does anyone had success with PHP???

Poster: dagon
Dated: Friday May 31 2002 - 19:38:36 BST

I'm trying to load the menu as PHP including the .js scripts renamed .php in my pages but it don't works!!!! Does anyone know if it's possible?? I put <script language=javascript> and </script> on the renamed .js. I think the problem is mmenu.js version 3.4.07 line 474: the tag </script> on that line truncates the execution of the javascript... I don't know what to do...

works in php

Poster: mstill
Dated: Tuesday June 11 2002 - 8:59:29 BST

yes, it works in php. this site is done in php

Poster: dagon
Dated: Thursday June 13 2002 - 21:46:23 BST

My site also is written in php, but the menu still remains dhtml... do you know the way to use the menu as php??

php includes

Poster: mstill
Dated: Thursday June 13 2002 - 22:30:47 BST

you need to make sure the includes are placed in the body tag if you're doing it that way. they can't be included in the <head> or before the <html> tag.

Make the include to be the first line after the <body> tag.

Poster: mstill
Dated: Thursday June 13 2002 - 22:54:37 BST

here's the code i used in my php to call the menu:

<BODY BGCOLOR="#000000" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>
<? include("menu_array.php");

here is the beginning of menu_array.php:

<script type=text/javascript>
Milonic DHTML Website Navigation Menu - Version 3.4 ...

and at the end of the include file use the normal </script>

i think the problem you were having is the "language=javascript part" give this a shot in both the mmenu.php and menu_array.php files.

Poster: dagon
Dated: Friday June 14 2002 - 21:21:40 BST

I've done exactly as you suggested, but there's no way... don't works yet ! It's frustrating!!! The output is always the same, that is the page loads without menu but with an error text ( "); for(x=0;x ) and a javascript error alert ( Unterminated String costant ).

I uploaded an example page, if you have a little time to help me go there and see if I'm mistaking something:

Do you have a working site with the php menu?? May you tell me the url??
Thanx for your time! Bye!

Poster: SoTTo
Dated: Saturday June 15 2002 - 16:21:40 BST

Don't put the script of the mmenu.js file in your page to it like this
<SCRIPT language="JavaScript" src="mmenu.js" type="text/javascript"></SCRIPT>

(and see that you have a file named mmenu.js with the script!)

(you can also put the menuarray in an external file like this)

... i tried it with your page and it worked when i used the mmenu.js file...

Greetz SoTTo

Poster: dagon
Dated: Sunday June 16 2002 - 11:05:35 BST

yes soTTo, if i call the menu in the standard mode as you suggest it works. But my goal is to run the javascript using PHP variables and eventually a mySQL database, so I have to call the .js menu as .php menu with the command "include" (see the last mstill's post) or "require". For this reason all the javascript code of the menu appears in the source of the (dynamic) page, and for this reason it don't works. The problem is the double </script> inside the same script (mmenu.js)... I'm not javascript coder so I dunno how to resolve!

Interested in a solution

Poster: himerus
Dated: Tuesday June 25 2002 - 17:48:55 BST

I have to agree, that the solutions posted above don't work in my case.

I'm trying to make the menu php, so that I may pass my global variables to it, so it knows which menu functions to generate provdied the level of the authenticated user. the varaibles I'm using are stored in a session, and it is the only part that won't work..

I've renamed the menu_array.js to menu_array.php and included php code in the menu_array file, with success pulling from a seperate config file that list my menu options in a multi-dimensional array....

I've only spent overnight working on this, but I would be happy to see if someone has done something simillar with this, and will let everyone know if I have success..


Poster: dagon
Dated: Thursday June 27 2002 - 19:17:52 BST

In the old posts of this forum several guys say that making the menu PHP is possible and it works.. but all the solutions they suggest don't work, so for now I think it's impossible! But I hope I'm mistaking...

some small sucesses found...

Poster: himerus
Dated: Thursday June 27 2002 - 20:33:52 BST

I have been able to make some minor improvements that allow varaibles to be called from my file. I have the menu checking the user level of a authenticated user, and only showing menu options that are appropriate for that user... I have also been able to remove some of the menu items from the menu_array file, which I have renamed to menu_array.php, but still call both files in the <head></head> of each page using includes.

I'm working now to use mysql to build the menu.

Should be fun.... :)

Poster: dagon
Dated: Sunday June 30 2002 - 19:45:59 BST

Wow! If I have understood your php menu works and you are able to use php global variables in it!! So you can modify dinamically your menu_array.php... is it true???
I have a basical problem... I can't include the two js as php neither in the body part nor in the head part!! Simply the menu doesn't appear in both cases... may you help me?? Have you got an example online of the working php menu? Thanx!

Re: some small sucesses found...

Poster: gautam_anant
Dated: Wednesday June 6 2007 - 12:17:56 BST

Hi himerus

I have seen ur posting for dynamic menu genration on the basis of user access level. I'm also working on such menu generation, I would be thankful to you if you provide me the code for the same.

Please reply as soon as possible. [/quote]

Poster: Ruth
Dated: Wednesday June 6 2007 - 14:59:57 BST


I don't think you will get a response on this, that was posted back in 2002. If you are using the new menu, i.e. version 5 you'll need to post in the support section for that version, if you are using the old one, version 3, I just wanted you to be aware you may get no help. There is no support for it at Milonic anymore and unless someone who uses it responds [this hasn't happened in a few years now] you'll need to upgrade to the new version 5 which contains a php menu and a php mysql menu and an asp menu. You might take a look at the new version and download the trial.