Creating HTML content with PHP when it's called from an image

46 Views Asked by At

Good morning,

I'm creating a tracking pixel for my emails that uses PHP to add a record to the server.

I want to make this PHP file create an HTML paragraph that will show to the email reciever.

My question is: How can I do that when my PHP is set as source of an image?

My HTML file looks like this:

<!-- THERE IS WHERE I CALL THE PHP FILE -->

<img src="http://example.com/file.php">

<!-- I want that the PHP file creates a new paragraph here -->

My PHP file looks like this:

<!-- THIS GENERATES A 1*1 PIXEL (copied from StackOverflow) -->

  $im=imagecreate(1,1);

  $white=imagecolorallocate($im,255,255,255);

  imagesetpixel($im,1,1,$white);

  header("content-type:image/jpg");

  imagejpeg($im);

  imagedestroy($im);

<!-- AND HERE I WANT TO CREATE AN HTML PARAGRAPH WITH SOME TEXT -->

I don't know if that's possible, and I would really appreciate your help,

Thank you very much,

MK.

0

There are 0 best solutions below