It’s similar to how a normal img tag with a script would be used for something like a captcha image - the viewer (in this case the email client) connects to the server and runs the script, and your script returns some kind of image (often a small blank, but could be a company logo or whatever) which is displayed. In the background, though, it’s recorded that the user with that id has opened their email. Or previewed it.
Obviously if they have images disabled, or a number of other ways, it’s not going to work.
I did not set this in my email program but by default any emails with images have the images hidden to presumably stop you finding out if the email has been opened.
I would think this is to help prevent spammers knowing if the email address is a valid one.
So it is not a very efficient way to track emails.
Yes, have a look also at http://stackoverflow.com/questions/900207/return-a-php-page-as-an-image which covers it and links to the php manual for more information. Obviously before you return the image data you’d update your database too as that’s the point of calling the script. The idea is that instead of pointing the img tag to your jpg you point at the php script, which then must return the image data once it’s done whatever it needs to do.
And yes, as @rubble mentioned, if your clients have images disabled, then this won’t work very well.
No, the correct way to have more than one $_GET variables is like folder/logo.php?first=foo&second=bar&third=baz
the &s should be coded as &s if you don’t want problems
Although there are ways to rewrite a request to a web server to do different things when you call for a resource (like an image file), it simply isn’t normal or usually a necessary practice to call on an image to make other things happen in the web server. It overcomplicates the server setup. If an image resource is called, an image should be served. The best practice to do such tracking through an image request is to simply request a php file and let PHP send out the image as the proper response, as has been suggested earlier in this thread.