$link1 = "<a href="
$link2 = "> Click Here</a>"
$Website = $link1.$Website.$link2
getting a parse error, unexpected T-VARIABLE on line 2
it doesnt like the ">
I have been racking my brain trying to figure a way around this. anybody got any ideas or suggestions?
thanks
Chris
wrapping a variable in a html link tag
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Much better to do it on one line, but thought I'd give you a heads up as to why that code wasn't working - you need a semicolon at the end of each line, so you should have:
instead of:
Mac
Code: Select all
$link1 = "<a href=";
$link2 = "> Click Here</a>";
$Website = $link1.$Website.$link2;Code: Select all
$link1 = "<a href="
$link2 = "> Click Here</a>"
$Website = $link1.$Website.$link2And of course the double quotes are missing:twigletmac wrote:Much better to do it on one line, but thought I'd give you a heads up as to why that code wasn't working - you need a semicolon at the end of each line, so you should have:Code: Select all
$link1 = "<a href="; $link2 = "> Click Here</a>"; $Website = $link1.$Website.$link2;
Code: Select all
$link1 = "<a href="";
$link2 = ""> Click Here</a>";
$Website = $link1.$Website.$link2;Maybe something like this.
Code: Select all
printf ("<a href="%s" target="%s">%s</a>", $link, $target, $imageortext);- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK