I see your connection:
connetti_db($NomeDB,$con);
but do not see where you define $con before using it in the function.
Now I had no success looking up you function connetti_db() - perhaps an Italian version of php?
Try this link [
^] for some help in creating the connection.
Only a best guess since I didn't see the error you said you attached (you really need to cut/paste strings for Q&A input).