Modify php script for form

Replaced first script that I tried, but clicking submit on test server sends user to
search results. Not sure what the problem is.