The trick to successful photographic animation is consistency. You need each shot in the sequence to be as nearly identical as possible, with the only difference being the movement of the subject. This means that you really need a camera with manual exposure settings, and a tripod. A cable release or remote control is also an advantage.
One thing you will need is a good and consistent source of light. You can use a flashgun for this, but I wouldn't recommend it unless you have a good quality studio flash system. Most normal flashguns rarely produce a consistent output from one shot to the next. You don't tend to notice this in everyday photography, because most people don't often take sequences of identical photos, but if you use a flash to light your animation photos you will notice the light level flickering up and down, which will spoil the effect. Even using natural light from a window can be a problem, because if a cloud goes over the sun the light level will change. It's better to use a fixed source of light such as a couple of bright reading lamps or a constant photo flood light.
For a background I've used the small table-top studio I made for taking product shots, as discussed in this tutorial, but you can use whatever background you like. As you can see in this picture, I'm using a digital SLR on a solid tripod, with a cable release.
For this animation, I just want to show the doors and bonnet opening and closing, so it's important that the body of the car doesn't move between shots. A judicious application of Blu-Tac should help to keep it stationary.
It's a good idea to plan out in advance how many shots you want to take, and how long your finished animation will be. Animated GIFs are best used for very short, simple clips, so don't plan on remaking The Lion King just yet. Aim for a maximum of around 20 frames. With a frame rate of 10fps this gives you a 2-second animation, ideal for a website illustration or forum avatar. Plan out the movement of your subject so that whatever movement you are animating is completed smoothly in the required number of frames.
Since the finished animation is going to be quite small, you don't need to shoot at full resolution. In fact this is one of the few times your camera's 640 x 480 resolution setting will actually come in handy.