If a file is uploaded to the server, is there a way using PHP, to make sure that it\'s actually a picture and not just a file with a .jpg or .gif extension?
Using (part) of the GD library.
PHP: GD - Manual
array getimagesize ( string $filename [, array &$imageinfo ] )
The first element of the array will be 0 if there is no image. PHP: getimagesize
If you don't have GD installed (most of the time you will), you can read the file header as Shane mentioned.
EDIT: Actually, as Neal pointed out in the comments, the GD library is not even required to use this function. So use it.