PHP comes with a graphics library called GD which is used in generating graphics "on the fly". It is a standard package that comes with PHP and is often compiled with PHP when it is installed.
The library can create picture with PHP commands. This allows people to generate whatever pictures they want, write text into the picture, add their own effects etc.
In the case of this generator the programmer creates a picture and then displays it to the users as a GIF/JPG/PNG picture. I have created many scripts like this for things like generating charts for statistical website data.
Below is a link to the section of PHP.net which describes how these various image functions work...
PHP: GD - ManualNow this isn't the only library you could use, but it is one of the most popular. As you will see from this link above there are tons of functions that can be used for creating shapes, lines, putting pictures in other pictures (like the little pokemon graphics on the card) etc.
So read through the pages there and check out their examples section for a simple example of generating a PNG file (just like the trainer card).
PHP: GD Examples - ManualHope this helps!
"At DIC we be pokemon training code ninjas... I single handedly trained Zangoose but he ran away because he claimed I was a bad parent. All pokemon have to eat their brussel sprouts"