It looks like the trigger is set to before page load. You should only do this if you can ensure that the variables will be present before the page loads.
Another thing you can try with this insert is to set the redirect page. After setting this you should be able to test the page and get to the redirect page. Please give this a try and let us know what you experience. This will let us know if you are getting through the server behavior or not.