You don't need $string in there. There is no need to capture the return value from imagestring into a variable, and certainly no need to use that variable as the filename argument when calling imagegif.
You can also check out "The Big GD Guide - Part 1" in Salathe sig.
Which also uses GD!
"The reasonable man adapts himself to the conditions that surround him... The unreasonable man adapts surrounding conditions to himself... All progress depends on the unreasonable man." - George Bernard Shaw
What exactly doesn't work? I, myself, thought at some point that GD was so god damn hard. But then I delved into it, and using just the php.net reference I was able to create a captcha system of my own (a very basic one, but it worked). So it isn't that hard. After that, more followed (like a simple graph system, some statistics generators and even an image manipulation library). You just need to get the point. And practice
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.