Jump to content

Archived

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

aviatorisu

echo HREF variable inside PHP tags

Recommended Posts

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

[code]
<!-- 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 -->
[/code]

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

Thanks in advance...

~Z~

Share this post


Link to post
Share on other sites
then put the $menu inside the href:

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

Share this post


Link to post
Share on other sites
[!--quoteo(post=377504:date=May 26 2006, 10:42 PM:name=hvle)--][div class=\'quotetop\']QUOTE(hvle @ May 26 2006, 10:42 PM) [snapback]377504[/snapback][/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~

Share this post


Link to post
Share on other sites
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 != '' )

Share this post


Link to post
Share on other sites
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~

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.