hello, any ideas on how to inject php code into a JPG image, without having to corrupt the image ,

i was using hexedit to write php code into it but my Firefox browser wont open it , it will open it like a image and show me the image , any ideas on how to run the code inside the image , or how to make it readable to any browser

thanks in advance