I got my CGI form send working!
Mar. 8th, 2007 12:16 amIf you're not a web geek, the following will probably be supremely uninteresting.
I was working on my GPS Potty web site, specifically the rest area submission page tonight in class. I've never done anything with CGI and forms before, and I got it working! It was easier than I expected. The Dreamweaver form designer did a very easy job of making the form itself, including setting maximum field lengths and combo boxes. Then setting up everything for the CGI was pretty simple. You create a template file linked to the field names on the HTML page that is saved as a text file. In the HTML page, at the start of the form declaration, you point to your web site's CGI directory and the name of your form script, mine is a script called CGIEMAIL developed (or at least archived) at MIT, that declaration also points to the template file. Finally, the code for the Submit button (I think) references a function in the script through value="Send e-mail", but that name might vary depending upon the CGI script.
Anyway, what I ended up with as an email that looks like the following:
Your Name? Wayne
Your Email Address? xxxxx@yahoo.com
State? nm
Highway/Interstate Name? x
Direction of Travel? North
Nearest Mile Marker before Rest Area: y
Latitude? x
degrees? q
direction? North
Longitude? q
degrees? q
direction? West
Name of Facility? q
Facility Type? Full Service
General Description? q
So now I need to start working on a PHP/database interface so that (1) people can upload sites directly into a temporary database that I can review directly online then copy them into the live table, and (2) generate the site lists directly from a database table. I also want to have a couple of code routines that convert latitude/longitude into a different format so that I can directly link them to Google Maps so that a user can directly see where any given rest area is. Another routine that I want is one that would directly produce a file that you could upload straight into your GPS that would have your waypoints right there for you. And finally, a program that would maintain a user login/preferences system, not unlike the Geocaching site. I imagine that I'll learn how to implement the third item as I pursue the database integration issue.
The thing that sucks is that I still have my hosting service issue hanging over my head. I submitted a post to Slashdot asking for hosting suggestions as I have not yet found a really good comparison of hosting services online, but my submission has been marked as pending for over a week. I have a feeling that I'll end up with DreamHost, but I'm not looking forward to it as they're more than twice what I was paying at Scottsdale Hosting.
I was working on my GPS Potty web site, specifically the rest area submission page tonight in class. I've never done anything with CGI and forms before, and I got it working! It was easier than I expected. The Dreamweaver form designer did a very easy job of making the form itself, including setting maximum field lengths and combo boxes. Then setting up everything for the CGI was pretty simple. You create a template file linked to the field names on the HTML page that is saved as a text file. In the HTML page, at the start of the form declaration, you point to your web site's CGI directory and the name of your form script, mine is a script called CGIEMAIL developed (or at least archived) at MIT, that declaration also points to the template file. Finally, the code for the Submit button (I think) references a function in the script through value="Send e-mail", but that name might vary depending upon the CGI script.
Anyway, what I ended up with as an email that looks like the following:
Your Name? Wayne
Your Email Address? xxxxx@yahoo.com
State? nm
Highway/Interstate Name? x
Direction of Travel? North
Nearest Mile Marker before Rest Area: y
Latitude? x
degrees? q
direction? North
Longitude? q
degrees? q
direction? West
Name of Facility? q
Facility Type? Full Service
General Description? q
So now I need to start working on a PHP/database interface so that (1) people can upload sites directly into a temporary database that I can review directly online then copy them into the live table, and (2) generate the site lists directly from a database table. I also want to have a couple of code routines that convert latitude/longitude into a different format so that I can directly link them to Google Maps so that a user can directly see where any given rest area is. Another routine that I want is one that would directly produce a file that you could upload straight into your GPS that would have your waypoints right there for you. And finally, a program that would maintain a user login/preferences system, not unlike the Geocaching site. I imagine that I'll learn how to implement the third item as I pursue the database integration issue.
The thing that sucks is that I still have my hosting service issue hanging over my head. I submitted a post to Slashdot asking for hosting suggestions as I have not yet found a really good comparison of hosting services online, but my submission has been marked as pending for over a week. I have a feeling that I'll end up with DreamHost, but I'm not looking forward to it as they're more than twice what I was paying at Scottsdale Hosting.
no subject
Date: 2007-03-08 09:07 pm (UTC)no subject
Date: 2007-03-08 10:22 pm (UTC)