Jump to content

Archived

This topic is now archived and is closed to further replies.

Brenty

Java menus in php?

Recommended Posts

Hello & HELP!,

I'm struggling with some code - I need to set a condition in php, and if this condition is true, then I need to run a java script, which is for a Java menu.

This is the condition...

[code]<?php if(permission("products","read")==TRUE)[/code]

And this is the Java script as I would have called it through HTML...

<script src="menu.js"></script><script menumaker src="menu_.js"></script>

So how on earth do I combine the 2 together?

Please someone help, I'm really trying hard to learn php, and every now and then I hit a wall, like now.

Share this post


Link to post
Share on other sites
[code]
<?php

if(permission("products","read")==TRUE) {

print "<script src=\"menu.js\"></script><script menumaker src=\"menu_.js\"></script>

}

?>

[/code]

Cheers ;)

Share this post


Link to post
Share on other sites
You pretty much wrote it yourself, you might want to check the manual on if statements...

[code]
<?php
if (permission("products","read") == TRUE) {
  echo '<script src="menu.js"></script><script menumaker src="menu_.js"></script>';
}
[/code]

Share this post


Link to post
Share on other sites
YAHOOOO! It worked!!!!!!!

You guys are life savers! And I've learned just that buit more! Sometimes you're just so near, but so far!

Many many thanks!

Share this post


Link to post
Share on other sites
[!--quoteo(post=354350:date=Mar 12 2006, 11:31 PM:name=Brenty)--][div class=\'quotetop\']QUOTE(Brenty @ Mar 12 2006, 11:31 PM) [snapback]354350[/snapback][/div][div class=\'quotemain\'][!--quotec--]
YAHOOOO! It worked!!!!!!!

You guys are life savers! And I've learned just that buit more! Sometimes you're just so near, but so far!

Many many thanks!
[/quote]

Any time.. don't hesitate to ask any more Q's!! [=

Share this post


Link to post
Share on other sites
Well, if someone could take a look at this, it would really get me out of a hole: [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=88051\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=88051[/a]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.