Jump to content


Photo

echo HREF variable inside PHP tags


  • Please log in to reply
4 replies to this topic

#1 aviatorisu

aviatorisu
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 27 May 2006 - 04:59 AM

Okay, I must be having a serious brainfart here, because I can't seem to put together how to make this work:

<!-- START VIEW MENU -->
<TD ALIGN="CENTER" WIDTH="120" BGCOLOR="#FFFFFF">
<?php if ( $menu != 'NULL' ) {    echo "<A HREF='../menus/$menu#zoom=150[,0,0]&toolbar=false' target='popup' onClick='wopen('../menus/$menu#zoom=100[,0,0]&toolbar=false', 'popup', 800, 600); return false;'>Menu</A>";}
?>
</TD>
<!-- END VIEW MENU -->

I need the $menu variable to echo within the A HREF tags...why can't I think straight tonight??

Thanks in advance...

~Z~

#2 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 27 May 2006 - 05:42 AM

then put the $menu inside the href:

echo "<a href=\"$menu\"> ..... ";

Life's too short for arguing.

#3 aviatorisu

aviatorisu
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 27 May 2006 - 05:46 AM

[!--quoteo(post=377504:date=May 26 2006, 10:42 PM:name=hvle)--][div class=\'quotetop\']QUOTE(hvle @ May 26 2006, 10:42 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
then put the $menu inside the href:

echo "<a href=\"$menu\"> ..... ";
[/quote]

It IS in there, and that doesn't work...I tried it that way...

~Z~

#4 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 27 May 2006 - 06:02 AM

then $menu is null.

your if statement maybe wrong:

if ( $menu != 'NULL' ) return true if $menu does not contain the word 'NULL' itself.

you may want to change to
if ($menu != null)
or
if ( $menu != '' )
Life's too short for arguing.

#5 aviatorisu

aviatorisu
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 27 May 2006 - 06:36 PM

Okay, it is working now somewhat...

The IF, ELSE statement works, but when using \"$menu\" , I am getting the url with quotes around it, and that is not working...

~Z~




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users