saco Posted October 13, 2006 Share Posted October 13, 2006 Hi!I am having problems inserting variables into h ref.how do I do it? Link to comment https://forums.phpfreaks.com/topic/23869-using-variables-in-h-ref-tag/ Share on other sites More sharing options...
MrLarkins.com Posted October 13, 2006 Share Posted October 13, 2006 hmm, need more info, but i'll try a blind answer[code]echo ("<a href='$link'>$link</a>");[/code] Link to comment https://forums.phpfreaks.com/topic/23869-using-variables-in-h-ref-tag/#findComment-108432 Share on other sites More sharing options...
tleisher Posted October 13, 2006 Share Posted October 13, 2006 Or you could also do:echo "<a href='"" . $var . "\">Link</a>"; Link to comment https://forums.phpfreaks.com/topic/23869-using-variables-in-h-ref-tag/#findComment-108436 Share on other sites More sharing options...
saco Posted October 13, 2006 Author Share Posted October 13, 2006 Hi!,this is the problem I am having:echo("<tr><td><a href=http://www.test.com/$item_name.htm>Download</a></td></tr>");$item_name is the variable, and I need to put the file extension after the variable.the reply is http://www.test.com/.htmthanks very much! - sorry, disregard last postSaco Link to comment https://forums.phpfreaks.com/topic/23869-using-variables-in-h-ref-tag/#findComment-108445 Share on other sites More sharing options...
MrLarkins.com Posted October 13, 2006 Share Posted October 13, 2006 is the url a variable? or just the clickable text? Link to comment https://forums.phpfreaks.com/topic/23869-using-variables-in-h-ref-tag/#findComment-108450 Share on other sites More sharing options...
tleisher Posted October 13, 2006 Share Posted October 13, 2006 echo "<tr><td><a href=\"http://www.test.com/" . $item_name . ".html\">Download</a></td></tr>"; Link to comment https://forums.phpfreaks.com/topic/23869-using-variables-in-h-ref-tag/#findComment-108460 Share on other sites More sharing options...
MrLarkins.com Posted October 13, 2006 Share Posted October 13, 2006 ah, i see what he was trying to ask...good job tleisher! Link to comment https://forums.phpfreaks.com/topic/23869-using-variables-in-h-ref-tag/#findComment-108463 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.