mike1313 Posted December 2, 2007 Share Posted December 2, 2007 I didn't know whether I should have posted this in the PHP forum or the JavaScript but I can't seem to get this to work. Bit of a noob question. echo "<b><a href=# onclick=displayMessage('message.inc');return false>$who2[username]</a></b><br>"; And it doesn't work with "" for the onclick function so how can I make this work? Link to comment https://forums.phpfreaks.com/topic/79806-php-and-js-help/ Share on other sites More sharing options...
PHP_PhREEEk Posted December 2, 2007 Share Posted December 2, 2007 'tis a PHP question.. you got the forum right. Your echo is between double quotes " -- " If you need to use double quotes inside the double quotes, they need to be escaped (prepended with back slash). echo "<table border=\"1\"><a href=\"http://etcetc.com\">etcetc.com</a></table>"; PhREEEk Link to comment https://forums.phpfreaks.com/topic/79806-php-and-js-help/#findComment-404132 Share on other sites More sharing options...
Stooney Posted December 2, 2007 Share Posted December 2, 2007 try echo "<b><a href=# onclick=\"displayMessage('message.inc'); return false\">$who2[username]</a></b><br>"; untested, but might help Link to comment https://forums.phpfreaks.com/topic/79806-php-and-js-help/#findComment-404136 Share on other sites More sharing options...
Dane Posted December 2, 2007 Share Posted December 2, 2007 echo "<b><a href=# onclick=\"displayMessage('message.inc'); return false\">".$who2[username]."</a></b><br>"; Link to comment https://forums.phpfreaks.com/topic/79806-php-and-js-help/#findComment-404171 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.