almightyegg Posted November 6, 2006 Share Posted November 6, 2006 [code=php:0] echo "<a href=http://www.lordoftheabyss.com/player/view.php?id=$player[id]>stripslashes($r['username'])</a>"; ?>[/code]i get this error ???[quote]Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/lordofth/public_html/forum/viewthread.php on line 154[/quote]is it to do with the stripslashes?? Quote Link to comment Share on other sites More sharing options...
Caesar Posted November 6, 2006 Share Posted November 6, 2006 Try...[CODE]<?php $pname = stripslashes($r['username']); echo "<a href=http://www.lordoftheabyss.com/player/view.php?id=$player[id]>$pname</a>";?>[/CODE] Quote Link to comment Share on other sites More sharing options...
xtentic Posted November 6, 2006 Share Posted November 6, 2006 HiSecond post :PThis is better[code]<?phpecho "<a href=\"http://www.lordoftheabyss.com/player/view.php?id=" . $player[id] . "\">" . stripslashes($r['username']) . "</a>"; ?>[/code]You cannot include code in an echo without using end quots or " (sorry don't know the right word).So the upper example would be correct... (think so) Quote Link to comment Share on other sites More sharing options...
almightyegg Posted November 6, 2006 Author Share Posted November 6, 2006 cheers it works :) (i tried both ways and both worked :D) 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.