I'm afraid I've never used PHP 4 for this type of thing! I don't know what kind support there is for curl, or what kind of "not working" your example is. I think there was some stream support in PHP 4, so you could research how to create the context you need to POST your content.

You probably don't need me to tell you that PHP 4 is no longer supported; I must strongly recommend that you upgrade.