hi,
It would me much easier for peop;e to help you if you upload your file and post a link.
keep in mind that php is a server-side script, meaning it reside on the server and not all servers are configure the same, so it may not work on your test server but might work online on different configuration