Page 1 of 1

echo in HTML link

Posted: Thu Sep 30, 2010 5:24 pm
by j2dao2dae
Hi,

Hoping this is posted in the right place. I'm getting a bit stuck . . . I want to display a PHP echo in a HTML link, for example:

http://www.test.co.uk/$name

I want the $name to display as echo. I'm currently using:

<a href="http://www.test.co.uk/<?php echo $name['name']; ?>" target='_blank' >Click Me</a>
This along with the request code kind of works but only displays / links the first letter and not the full echo.

Can someone please advise the best way to echo in a HTML link?

Hope this makes sense and thank you for your time.

Re: echo in HTML link

Posted: Thu Sep 30, 2010 6:40 pm
by twinedev
Based on that you are getting only the first letter, I would guess that $name is not actually an array, but a string, so probably just do echo $name;

-Greg