Page 1 of 1

echoing a link tag is echoing as text

Posted: Mon Mar 16, 2009 5:17 pm
by jeffduck
This may be a bit simple but is beyond me...

There's a class involved in this but I'm leaving it out because I think it will make things more confusing. I'm attempting to do this:

Code: Select all

[color=#FF0000]<?php[/color] 
$imageNameA = "<a target='new' href='http://click.anagency.com/fs-bin/click?id=abcdef&offerid=12345.10000130&type=4&subid=0'><IMG alt='acompany' border='0' src='http://images.acompany.com/email/affiliate_new/Laptops_120x240.gif'></a>";
[color=#FF0000]?>[/color]
I have used single and double-quotes in the link but they don't matter either way because they are modified by the class before they actually go to the variables.

Code: Select all

<div align="center">
    [color=#FF0000]<?php[/color] echo $imageNameA;[color=#FF0000] ?>[/color]
</div>
This echos the contents of the variable as a string of text rather than producing the desired link and image.

But when I use this...

Code: Select all

<div align="center">
        <a href="[color=#FF0000]<?php[/color] echo $imageLinkA; [color=#FF0000]?>[/color]" target="_blank">
            <img src="[color=#FF0000]<?php[/color] echo $imageNameA; [color=#FF0000]?>[/color]" height="[color=#FF0000]<?php[/color] echo $imageHighA; [color=#FF0000]?>[/color]" width="[color=#FF0000]<?php[/color] echo $imageWideA; [color=#FF0000]?>[/color]" alt="[color=#FF0000]<?php[/color] echo $imageAltA; [color=#FF0000]?>[/color]" class="topPadding"  border="0" />
        </a>
</div>
I end up with the desired image and link.

The data that populates the variables in the second example (that works) is cut-and-pasted from the same text that is used in the first example. The use of single vs. double-quotes has no effect.

Any advice will probably extend my lifespan and may save my marriage - thanks much

Re: echoing a link tag is echoing as text

Posted: Mon Mar 16, 2009 6:27 pm
by panic!
I tried the first one and it seemed to work for me

Image

Re: echoing a link tag is echoing as text

Posted: Mon Mar 16, 2009 6:46 pm
by jeffduck
I'm getting this in both FireFox and IE6...

(Still as a text string, not tags in the browsers and with FireBug)

Code: Select all

<a target='new' href='http://click.anagency.com/fs-bin/click?id=abcdef&offerid=12345.10000130&type=4&subid=0'><IMG alt='acompany' border='0' src='http://images.acompany.com/email/affiliate_new/Laptops_120x240.gif'></a>
I've got other very similar variables contents that work fine but none of them have any parameters in the URL or use external images for the source.(?)