Mike088 Posted October 14, 2008 Share Posted October 14, 2008 Hey all, I am having trouble with printing a hyperlink which includes insertion of variables to complete the link. This is what I got... which is most likely wrong lol: <?php print ("<a href=\"http://mysite.com/place/"$page"/blahblah"$text">Click Me</a>"); ?> I'm getting "Parse error: syntax error, unexpected T_PRINT" Help appreciated Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted October 14, 2008 Share Posted October 14, 2008 either remove the extra quotes or add concatenation operators no half-way print ("<a href=\"http://mysite.com/place/$page/blahblah$text>Click Me</a>"); or print ("<a href=\"http://mysite.com/place/".$page."/blahblah".$text.">Click Me</a>"); Quote Link to comment Share on other sites More sharing options...
CroNiX Posted October 14, 2008 Share Posted October 14, 2008 either remove the extra quotes or add concatenation operators no half-way print ("<a href=\"http://mysite.com/place/$page/blahblah$text>Click Me</a>"); or print ("<a href=\"http://mysite.com/place/".$page."/blahblah".$text.">Click Me</a>"); you left off the ending escaped quote: print ("<a href=\"http://mysite.com/place/".$page."/blahblah".$text."\">Click Me</a>"); Quote Link to comment Share on other sites More sharing options...
Mike088 Posted October 14, 2008 Author Share Posted October 14, 2008 Thanks for your replies got it working cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.