passing variables...

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
emiljansson
Beginner
Beginner
Posts: 5
Joined: Sat Jan 20, 2007 1:17 am

passing variables...

Post by emiljansson »

Hi

An old question i know but i can't put variables in my php/mysql setup.
php will not execute it at all.

like: user?id=<?php $user; ?> (i have tryed all possible way that i know to write it. inc print...)

I have made the .js to .php renaming of the menu_data file...

what more can it be?

/e
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Can you send over a sample of how you are adding the variable?

Is it being added in the database or inside php?
emiljansson
Beginner
Beginner
Posts: 5
Joined: Sat Jan 20, 2007 1:17 am

Post by emiljansson »

http://www.kvickstream.se/demo.php

and i add the variables in the database exactly like this:
account.php?id=<?php $user_id; ?>

/e
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

You need to echo the variable, like this:

aI("text=Mitt konto;url=admin/account.php?id=<? echo $user_id; ?>;");
emiljansson
Beginner
Beginner
Posts: 5
Joined: Sat Jan 20, 2007 1:17 am

Post by emiljansson »

Hi,

Sorry but i didn't work, get the same results.
Changning to do a funktion for it instead.

I got an other probelm too, the first time the menu loads it give the mm_style is unidentified, but it works and dissaperar after reload.

how can i correkt that probelm?

/e

Andy wrote:Hi,

You need to echo the variable, like this:

aI("text=Mitt konto;url=admin/account.php?id=<? echo $user_id; ?>;");
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

There must be something else going on here.

Does the PHP menu "out of the box" work on your site?

-- Andy
emiljansson
Beginner
Beginner
Posts: 5
Joined: Sat Jan 20, 2007 1:17 am

Post by emiljansson »

Nopp,

for example... the <script language="JavaScript" src="http://www.xxx.xx/menu/menu_data.php" type="text/javascript"></script> is not by default in the index.php file that's in the package.

Acctually, the demo that i downloaded at first was working well but when i buyd the license the code was rewrighten and wasn't working.

And for extra information, the .zip file had even more error then the .tar file.

And the link to mmenudom.js and mmenuns4.js has been change to be included in the mm_phpmenu.php file. that's the changes that i can see now and difference from the working one for me.

/e
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

When I visit http://www.kvickstream.se/demo.php I get an error: mm_style is undefined.

This looks like it is because you are calling http://www.kvickstream.se/menu/menu_data.php before you have executed the menu code files and thus objects are not available

I have double checked this line of code and it's working fine: aI("text=Mitt konto;url=admin/account.php?id=<? echo $user_id; ?>;");
emiljansson
Beginner
Beginner
Posts: 5
Joined: Sat Jan 20, 2007 1:17 am

Post by emiljansson »

Right, now i get it :)

the demo script that í downloaded had the above link i think but the funktion is already in mm_phpmenu.php. My misstake!

Now i instead got the _menuCloseDelay is undentifyed error but the php code just putout menuCloseDelay (no underscore _ in front).

So i just replaced all the funktions names in the .js files so it dosn't search for the _underscore funktion and now it all works like a charme.

I'm gone nock my head for a cupple of hour now with the $user_id funktion that still dont work.

So thanks for all help with this one for now and let's close this one! :)

BR/
Emil
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

There was a few changes made to the PHP Based sample a few days ago. I guess this caused you a few problems.

If you have anymore issues, please download the menu again and update all php files. And by all means contact us again if you have anymore problems.

Cheers,
Andy
Post Reply