conan318 Posted April 27, 2011 Share Posted April 27, 2011 echo '<a href="viewprofile.php?username='.$info['username'].'"><img src='http://datenight.netne.net/images/".$info['img']."' title='".$info['username']."' width='50' height='50'></a>'; im struggling with quotes driving me crazy can someone tell me where a good place to learn how to use quotes in php and help with this line of code. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' Link to comment https://forums.phpfreaks.com/topic/234818-synyax-erorr/ Share on other sites More sharing options...
Pikachu2000 Posted April 27, 2011 Share Posted April 27, 2011 PHP manual entry for strings echo "<a href=\"viewprofile.php?username={$info['username']}\"><img src=\"http://datenight.netne.net/images/{$info['img']}\" title=\"{$info['username']}\" width=\"50\" height=\"50\">Link Text Here</a>'; Link to comment https://forums.phpfreaks.com/topic/234818-synyax-erorr/#findComment-1206729 Share on other sites More sharing options...
conan318 Posted April 27, 2011 Author Share Posted April 27, 2011 <div class="random_frame"> <div class="random_user"> <?php echo "<a href=\"viewprofile.php?username={$info['username']}\"><img src=\"http://datenight.netne.net/images/{$info['img']}\" title=\"{$info['username']}\" width=\"50\" height=\"50\"></a>'; ?> </div> just tryed it but it seems to ignore the closing of the php? Link to comment https://forums.phpfreaks.com/topic/234818-synyax-erorr/#findComment-1206739 Share on other sites More sharing options...
kenrbnsn Posted April 27, 2011 Share Posted April 27, 2011 Do <?php echo "<a href='viewprofile.php?username={$info['username']}'><img src='http://datenight.netne.net/images/{$info['img']}' title='{$info['username']}' width='50' height='50'></a>"; ?> No escaped double quotes. Much cleaner IMHO. Ken Link to comment https://forums.phpfreaks.com/topic/234818-synyax-erorr/#findComment-1206741 Share on other sites More sharing options...
saurabhx Posted April 27, 2011 Share Posted April 27, 2011 echo "<a href='viewprofile.php?username=", $info['username'], "'><img src......"; For improved performance, use , (comma) instead of the dot operator. Just saying.. Link to comment https://forums.phpfreaks.com/topic/234818-synyax-erorr/#findComment-1206744 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.