I want to create an HTML snippet that I can paste into my iWeb website that allows my customers to search for this zipcode and connect to a site relevant to their location. I have a table (named ziplinks) in a MySQL database (named zipcodes). In the table there are three fields: zipcode (a five digit varchar(5)); territory (text); and link (text). When a user enters their 5 digit zipcode into the form and clicks "OK", I want the query to search the database for the matching 'zipcode' and redirect the visitor to the web address listed in the 'link' field relevant to the row returned in the search. If the search returns no matches, I want the visitor to be redirected to a custom page that I will upload which gives them a message that we are not currently serving their area.
I can edit a script to include a host name, database name, table name, username, password, etc. as needed if you can indicate in the code file where I should do so.
Does anyone know how to structure a code to accomplish this? Or, can anyone direct me to a resource to help me?