Does anyone had success with PHP???

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
User avatar
dagon
Advanced
Advanced
Posts: 29
Joined: Wed May 29, 2002 10:00 pm
Location: Udine, ITALY
Contact:

Does anyone had success with PHP???

Post by dagon »

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...
mstill
Beginner
Beginner
Posts: 6
Joined: Tue Jun 11, 2002 8:56 am
Location: California
Contact:

works in php

Post by mstill »

yes, it works in php. this site is done in php
User avatar
dagon
Advanced
Advanced
Posts: 29
Joined: Wed May 29, 2002 10:00 pm
Location: Udine, ITALY
Contact:

Post by dagon »

My site also is written in php, but the menu still remains dhtml... do you know the way to use the menu as php??
mstill
Beginner
Beginner
Posts: 6
Joined: Tue Jun 11, 2002 8:56 am
Location: California
Contact:

php includes

Post by mstill »

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.
mstill
Beginner
Beginner
Posts: 6
Joined: Tue Jun 11, 2002 8:56 am
Location: California
Contact:

Post by mstill »

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

Code: Select all

<html>
<HEAD>
</HEAD>
<BODY BGCOLOR="#000000" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>
<? include("menu_array.php");
	include("mmenu.php");
?>
here is the beginning of menu_array.php:

Code: Select all

<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.
User avatar
dagon
Advanced
Advanced
Posts: 29
Joined: Wed May 29, 2002 10:00 pm
Location: Udine, ITALY
Contact:

Post by dagon »

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: http://membres.lycos.fr/dagon7/news.php.

Do you have a working site with the php menu?? May you tell me the url??
Thanx for your time! Bye!
SoTTo
Advanced
Advanced
Posts: 26
Joined: Thu May 30, 2002 6:59 pm
Contact:

Post by SoTTo »

Don't put the script of the mmenu.js file in your page itself....link 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
Mommy, Look! The cursor's winking at me!
User avatar
dagon
Advanced
Advanced
Posts: 29
Joined: Wed May 29, 2002 10:00 pm
Location: Udine, ITALY
Contact:

Post by dagon »

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!
himerus
Beginner
Beginner
Posts: 2
Joined: Tue Jun 25, 2002 5:43 pm
Location: Steamboat Springs, CO

Interested in a solution

Post by himerus »

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..

Himerus
User avatar
dagon
Advanced
Advanced
Posts: 29
Joined: Wed May 29, 2002 10:00 pm
Location: Udine, ITALY
Contact:

Post by dagon »

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...
himerus
Beginner
Beginner
Posts: 2
Joined: Tue Jun 25, 2002 5:43 pm
Location: Steamboat Springs, CO

some small sucesses found...

Post by himerus »

I have been able to make some minor improvements that allow varaibles to be called from my config.inc.php 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.... :)
User avatar
dagon
Advanced
Advanced
Posts: 29
Joined: Wed May 29, 2002 10:00 pm
Location: Udine, ITALY
Contact:

Post by dagon »

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!
gautam_anant
Beginner
Beginner
Posts: 1
Joined: Wed Jun 06, 2007 12:10 pm

Re: some small sucesses found...

Post by gautam_anant »

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]
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hello,

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.

Ruth
Post Reply