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: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:08

PHP and Milonic


Poster: gamescrew
Dated: Saturday April 8 2006 - 16:16:36 BST

Hello,

After looking throught the examples I still remain with one simple question.

Is it possible to do some like this with the menu? :

menu_data.js --->
with(milonic=new menuname("Sample")){
margin=3;
style=vertStyle;
top="offset=2";
aI("image=18_about.gif;text=About Us;url=/aboutus.php;");
aI("image=profile.gif;text=My Profile;url=/profile.php?x=SOME_USER_NAME$;");
}

SOME_USER_NAME$ is a variable that contains the users name.

I have the page profile.php but only can use it for a specific user (which is logged in ofcourse)
The menu should then show the profile.php for that particular user.

Thanks in advance for your time replying.
Games Crew


Poster: WBHoenig
Dated: Sunday April 9 2006 - 22:07:51 BST

If I am corrent, just put:

Code:
menu_data.js --->
with(milonic=new menuname("Sample")){
margin=3;
style=vertStyle;
top="offset=2";
aI("image=18_about.gif;text=About Us;url=/aboutus.php;");
aI("image=profile.gif;text=My Profile;url=/profile.php?x=<?php echo $SOME_USER_NAME; ?>;");
}


Poster: John
Dated: Monday April 10 2006 - 15:40:17 BST

Don't forget that the suffix on your _data file will need to be changed from .js to .php.

PHP and milonic


Poster: gamescrew
Dated: Tuesday April 11 2006 - 14:12:18 BST

In the end it proofed indeed much more simple to combine PHP and milonic than i thought

menu_data.js --->
aI("text=Some Text;url=/profile.php?x=<?php echo $SOME_USER_NAME; ?>;");
}

To get for example the line profile.php?x=John

After renaming the data.js to data.php everything worked like a charm.
Life is fun with a bit of knowledge.

Thanks Milonic!


Poster: gamescrew
Dated: Tuesday April 11 2006 - 14:13:22 BST

(and WBHoenig)

Re: PHP and milonic


Poster: tlkemp
Dated: Thursday August 24 2006 - 19:29:43 BST

I am trying to do something similar.

I seem to be having a context problem with my PHP variables between the web page and the menu files. If the variable is set in the web page, it is not available to the menu files and vice versa.

Do I have to do something special to make the variables available in both contexts? Since the variable values are coming from mySQL, I guess I can just read them in both places if needed.


Poster: Andy
Dated: Monday September 4 2006 - 15:08:31 BST

All you have to do is rename the menu_data.js file to menu_data.php and the variables should then become available to you.