When you say it doesn't work 'the same' what do you mean?
I think you're going to need to debug this to see what is happening in each script. It's easy to get omething workong on a localhost wamp system but coding it to work on a variety of systems really does take skill!
I can debug this for you via teamviewer / vnc however as this would take a while I'd have to be paid for it. My advice here on CF is always free as its just advice and theoretical stuff but actually spending what could be several hours on someones code is time consumning hence payment. I appreciate you'd probably like to avoid this option but the offer is there as a last resort.
In the meantime, if you can provide us with more information as to what is going on, I'll still try to help here.