index.php
As your Ajax code knows all about the inputs (same page), why not just do this:
success: function(msg) { $("#risultati").html(msg); $("#zio").focus(); },
Your current version has a child page has knowledge of the parent page (bad separation).