Jump to content

Php and js help


mike1313

Recommended Posts

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

'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

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.