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 ';' Quote 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>'; Quote 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? Quote 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 Quote 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.. Quote Link to comment https://forums.phpfreaks.com/topic/234818-synyax-erorr/#findComment-1206744 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.