matrex722 wrote:can you please correct it for me
No, because that wouldn't be teaching you anything other than how to make other people do things for you. 🙂
The "@" character in front of a function/variable/expression/etc. is the PHP "error suppressor," meaning it hides all PHP error messages and prevents them from being logged. Bjom suggested that you remove all of them because a) they should never be necessary, and b) you can't properly debug code if you're telling PHP to ignore any errors in it.
So, remove the "@" error suppressors, make sure display_errors is turned On and error_reporting is set to E_ALL (check [man]phpinfo/man if you aren't sure), and try running your script again. See if any error messages appear and, if so, post them here for us.