I just programmed a file sharing script but I can't sell it because I don't know how to prove that I'm the programmer.
Simple. Mail it to yourself. The postmark is your proof. Do not open the package when it arrives. Just put it away. Do this for every major release and you should be okay.
But if you really want to be official, copyright your work and patent any invention including unique processes, calculations, methods, etc.
An easier alternative? Most attorney's will place things on file on your behalf. It is generally accepted that anything on file with an attorney has passed scrutiny. Discuss what you want to do with an attorney so that they understand. I have mailed notices with cc: Attny. Joseph Darby, Bleeker St. Mont Abby (my apologies if this ends up being a real person) and had the attorney file a copy of the letter which most will do for a very small fee or no fee at all. It has come in handy and no court within the U.S. will argue the word of an attorney. Significant weight is given to items filed within an attorney's office as being proper and right.
Even cheaper alternative? Have witnesses. Present your product to some friends and family members and be somewhat official by having them sign a document at the end. As well, be very vocal about what you are developing and what it does so that they can testify to these conversations and how hard and long you worked on your project. Also document the internals in extreme detail. If you can produce a detailed design document and the opposition cannot, then you win.
Best option? All of the above. Or at least several.