seany123 Posted May 14, 2009 Share Posted May 14, 2009 echo "<b><font color=\"$color\"><a href='../profile.php?id=" $username \"'></b></td>"; am I missing a \ or something?? Link to comment https://forums.phpfreaks.com/topic/158122-how-should-this-line-be/ Share on other sites More sharing options...
Zhadus Posted May 14, 2009 Share Posted May 14, 2009 Forgot to escape the first double quote before the username variable. <?php echo "<b><font color=\"$color\"><a href='../profile.php?id=\"$username\"'></b></td>"; ?> Link to comment https://forums.phpfreaks.com/topic/158122-how-should-this-line-be/#findComment-834044 Share on other sites More sharing options...
nadeemshafi9 Posted May 14, 2009 Share Posted May 14, 2009 echo "<b><font color=\"".$color."\"><a href=\"../profile.php?id=".$username."\"></b></td>"; or PHP5 echo "<b><font color=\"{$color}\"><a href=\"../profile.php?id={$username}\"></b></td>"; Link to comment https://forums.phpfreaks.com/topic/158122-how-should-this-line-be/#findComment-834048 Share on other sites More sharing options...
nadeemshafi9 Posted May 14, 2009 Share Posted May 14, 2009 Forgot to escape the first double quote before the username variable. <?php echo "<b><font color=\"$color\"><a href='../profile.php?id=\"$username\"'></b></td>"; ?> this works too but i prefer to have definition actualy thats still wrong <a href='../profile.php?id=\"$username\"'> WRONG CORRECT <a href=\"../profile.php?id=$username\"> <a href=\"../profile.php?id=".$username."\"> <a href=\"../profile.php?id={$username}\"> Link to comment https://forums.phpfreaks.com/topic/158122-how-should-this-line-be/#findComment-834050 Share on other sites More sharing options...
Zhadus Posted May 14, 2009 Share Posted May 14, 2009 Yeah, I didn't read through it as well as I should have, instead of forgetting the escape, should have just removed it completely. Link to comment https://forums.phpfreaks.com/topic/158122-how-should-this-line-be/#findComment-834054 Share on other sites More sharing options...
nadeemshafi9 Posted May 14, 2009 Share Posted May 14, 2009 Yeah, I didn't read through it as well as I should have, instead of forgetting the escape, should have just removed it completely. yeh i guess the more you have to do it the easier its to spot Link to comment https://forums.phpfreaks.com/topic/158122-how-should-this-line-be/#findComment-834059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.