updated with fixes to php form handling