Embedding Inside Images?
I'm fairly new on the scene, but please don't judge me by my progress on the challenges. Now that I've got that out of the way, I'm wondering if it is possible to embed mini-programs in to an image file. For example , say you wanted to log people's IP address when they executed the image file, or set a variable on a remote server , such as how many times it has been viewed…etc. I know that people embed things inside of .mp3s and movies, so it is just a thought. If anyone can point me in the right direction , I would appreciate it.
I'm KickMe by the way, Im New here, so what's up?
Intresting, by scripts do you mean that it would have to be interpted by the browser? I can somewhat program in c++.
EDIT:
Just a thought, but in order to display the image, the computer has to interpet the code, correct? So what is to say , that you can't execute code? Like Assembly or Something? Please stop me, If i start to sound to noobish.
Unfortunatly no, because assembly/c are compiled, and so cannot be executed unless compiled in to an executable. Scripts (php/perl) are executed by the server without being compiled, so they can be embedded in to files and interpreted as they are read, making them ideal for this purpose.
And no, you're not sounding noobish.
I don't know any PHP yet , but I'm going to look in to this somemore, I will post if I make any progress ;)
EDIT:
Something just came to me, what if you made a "script" and when executed it displayed an Image, while processing the actual script, and (just guessing) but you could trick the browser in to describing it as an image,( mouse over link would say image.gif , same for address bar).
What do you think?
A lot of people do things like this. They're simply dynamic images. Make a PHP script using GD libary or ImageMagick. It first does what you tell it, (database queries, records information, etc,) then displays the image.
You can have it use a .gif extension through mime types, or use internal mime types within a script to fake an extension.