PHP and Milonic

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
gamescrew
Beginner
Beginner
Posts: 5
Joined: Sat Apr 08, 2006 3:53 pm
Location: Holland

PHP and Milonic

Post by gamescrew »

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
WBHoenig
Beginner
Beginner
Posts: 3
Joined: Sun Apr 09, 2006 10:06 pm

Post by WBHoenig »

If I am corrent, just put:

Code: Select all

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; ?>;");
} 
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Don't forget that the suffix on your _data file will need to be changed from .js to .php.
John
gamescrew
Beginner
Beginner
Posts: 5
Joined: Sat Apr 08, 2006 3:53 pm
Location: Holland

PHP and milonic

Post by gamescrew »

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!
gamescrew
Beginner
Beginner
Posts: 5
Joined: Sat Apr 08, 2006 3:53 pm
Location: Holland

Post by gamescrew »

(and WBHoenig)
tlkemp
Beginner
Beginner
Posts: 1
Joined: Thu Aug 24, 2006 7:23 pm

Re: PHP and milonic

Post by tlkemp »

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.
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

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