What do you mean that it "doesn't work" ? The forum's software doesn't allow you to link to a .php file extension? Or, it does link fine, and you simply see a red X?
If the former is the case, you might be able to "cheat" the software by changing the file extension to .png and set PHP to parse .PNG file extensions in a certain directory. I believe I've seen this done before, anyway.
If the latter of the two is the case, can you post us a link to this image script?