Jump to content

synyax erorr


conan318

Recommended Posts

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

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

<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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.