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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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>"; Quote Link to comment 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.