PDA

View Full Version : Concatenation question


kobescoresagain
04-14-2006, 06:08 PM
I am trying to concatenate with a link. I want to take the variable $link which has the string http://www.url.com/ stored within it to that I want to concatenate something.php I want to try to do this inside of a hyperlink. I have tried many things. The following seems to be the closest I have gotten:
<a href=\"$link . \"createproject.php\"\">

But this doesn't work. I have tried quite a few ways, and I understand how to concatenate just strings, but I can't figure this out.

Please help me!!!!
:confused: :confused: :confused: :confused: :confused:

filburt1
04-14-2006, 06:18 PM
Provided you've already run $link through htmlspecialchars_uni() for security:

echo "<a href=\"{$link}createproject.php\">...</a>";

If in a template:

<a href="{$link}createproject.php">...</a>

Braces force the interpreter to read the contents as a variable.

kobescoresagain
04-14-2006, 06:25 PM
awesome, thanks alot. That worked like a charm.