Jump to content


Photo

Java menus in php?


  • Please log in to reply
5 replies to this topic

#1 Brenty

Brenty
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 12 March 2006 - 10:41 PM

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

<?php if(permission("products","read")==TRUE)

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.

#2 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 12 March 2006 - 10:44 PM

<?php

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

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

}

?>


Cheers ;)

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#3 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 12 March 2006 - 10:45 PM

You pretty much wrote it yourself, you might want to check the manual on if statements...

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


#4 Brenty

Brenty
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 12 March 2006 - 11:31 PM

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!

#5 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 12 March 2006 - 11:44 PM

[!--quoteo(post=354350:date=Mar 12 2006, 11:31 PM:name=Brenty)--][div class=\'quotetop\']QUOTE(Brenty @ Mar 12 2006, 11:31 PM) View Post[/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!! [=

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#6 Brenty

Brenty
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 13 March 2006 - 12:01 AM

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]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users