0

I have a simple php email script. This returns a simple text message saying the email has been sent successfully. I would like to add a green check mark icon next to it.

I tried including it as an img src, but it seems the output is only recognized as pure text.

$responseCompleted = 'Form successfully submitted. <img src="http://www.mywebsite.be/img/vink.png"><br>';

So how can I add the image?

Johan
  • 21
  • 1
  • 4

1 Answers1

1

You've got quotes in your quotes, you can't to that. You could use singles on the outside set and doubles on the inside set:

$responseCompleted = 'Form successfully submitted. <img src="http://www.mywebsite.be/img/vink.png"><br>';

Or escape the inner quotes with backslashes:

$responseCompleted = "Form successfully submitted. <img src=\"http://www.mywebsite.be/img/vink.png\"><br>";

You can't do this:

$foo = "this is "just" a test";

Or This:

$foo = 'this is 'just' a test';

But you can do this:

$foo = 'this is "just" a test';

And this:

$foo = "this is 'just' a test";
Alex Howansky
  • 50,515
  • 8
  • 78
  • 98
  • Thank you Alex, now the code passes without an error ... however the image is not displayed? Only the text part ... Any suggestions? – Johan Nov 09 '19 at 01:06