You have so many quotes inside quotes, you are going to have to
escape them to get this to work right. To escape quotes, you do something like this when you need double-quotes inside of double-quoted strings:
Code: Select all
$myString = "Henry said, \"I can do that!\"";
When this is echo'd, it will come out as: Henry said, "I can do that!"
That is what you need to do for this line of code. Escaped characters will not affect the PHP in the way they normally do (which would close the string), and will be echo'd out as a
literal, meaning they will be printed out verbatim. I won't actually escape it for you, because it will be good practice with this new technique, but I will say a definite problem exists in the image tag in your Javascript statement in regards to quotes
And this does not need to be in coding. It is in the right place. But yes, please do rename the thread title. Titles like "I can't solve this", or "Please help me" do nothing to help create a library of
searchable solutions on this forum. A proper title would be something like "Problem with echo'ing Javascript in PHP".