Sorry if this is in the wrong forum, I couldn't figure out where to put it.

I am setting up a web form on my site to receive requests for services. Right now, because I don't know any other way, I am using the "mailto:" action to have the info from the forms sent to me. I would like to use cgi/perl (I think this is what I want) to have the info placed into a database. My web hosting package includes a "cgi bin" folder. I have messed around a little with setting up a guestbook, so I know it works, but what else do I need? I own OfficeXP and have MS Access. Can I link the info that is on my ISP server to a database on my computer?

Thanks,
David
(always willing/trying to learn)

I don't know perl, but I bet if you go to google and search for "perl contact form" you will find something to work for you in the first 5 or so results.

Uh oh I think we might get another forum :p at Dani

I think that what you want to do, can not be done the way you want to do it. I researched a bit on using access with a Perl CGI, and this seems semi-possible, if the server that is hosting your CGI is running their server in windows with active perl. My guess is no, they are not. They are most likely using *nix system. Now, there is a solution to this, but it is probably more work than it's worth! Let me give you the break down.

You could have your Perl CGI Accept the user data, and write it to a database on the server, then you could even have it viewable to yourself on a web page. So you surf there, Log in, and view your "sign ups". Now to answer your actual question, you could build a program to connect to your server (through a number of means... FTP, HTTP, whatever), and retrieve that data from the server. That program then saves that data in an Access Database. So, User Enter Data, Server Saves The Data, A program on your computer requests the data, and saves it to an access database. ;)

I can do that! (can't I?) But what I need to figure out is (the hard part?)

...you could build a program to connect to your server (through a number of means... FTP, HTTP, whatever), and retrieve that data from the server.

Any idea where I need to start on that one??

well, you start by coding the CGI. If you would like... if you give me the relevant information, I can code it, or help you code it. The harder part will be coding sockets on the window side to retrieve the said information.

well, you start by coding the CGI. If you would like... if you give me the relevant information, I can code it, or help you code it. The harder part will be coding sockets on the window side to retrieve the said information.

That's an awful nice offer (to help me code it-I would never ask you to do it for me!)... wow. Is the CGI coding the *.cgi files that begin...

#!/usr/local/bin/perl
print ("Content-type: text/html\n\n");

...?

Right now I am in the self teaching mode and have found a few web sites that are helpful. If, however, I get totally bogged down I'll let you know. Thanks man.

So what I need first is to get the .cgi file up to my /cgi bin folder on my host server, then figure out how to get the info into a DB on my machine.

Right.

It all starts in baby steps. Every project starts in baby steps. When I first started programming, I had huge aspirations. I would take on a real huge project, and kept straying from the purpose. I'd keep coming up with new things to add to it, and wanting to change everything. Eventually, though, I learned that in order to complete a project successfully, you need to do it in steps. So, Start with making the web page. Ok, that's done. Now, build the CGI, and have the CGI save the information into a file. My personal opinion, is that due to simplicity, you could save the information that the user enters in a textfile. This will make it a little easier for the program on your computer to read the information that the CGI saved. I prefer a flat file, delimited by _:_ or Tabs, but whatever works for you.

Yes, CGI's usually start with: #!/usr/bin/perl. I go about printing the header a little different (I import CGI.pm), but, again, this is a matter of preference. If you have any questions, don't hesitate to ask.

Thanks Comatose. I will let you know. What you have shared already has been a great help, setting me off in the right direction. I do have a little experience importing data from delimited text files into an Access DB, so hopefully when I get to that point It'll all come back to me.

RS

The hard part isn't importing the delimited text files into access. The hard part is getting the user entered information from the server to your PC. Once it's on your PC, you can have access import it, or make the program import it into access. Again, the tough part, is getting it from server to pc.

Sorry to interupt... but if you have a cgi based form on your site, have it use the mail functions send it to an e-mail account, then daily check the e-mail acount, strip the details and save as text files, then import? You can set up outlook or Outlook express to access the e-m,ail accounts....you can even set times to auto-check(I think!)....

There is even software out there to auto-strip emails for you, if you look hard enough!

He already has it coming to him in E-mail. I think the whole idea is to avoid having it sent by e-mail.... otherwise, he could leave it like it is, and strip the details into an access database... right?

ok, re-read his orignal post, and yep, I guess that I missed that part
*oops*
well, why not php it? set up a simple DB, single table, contains;
D&T stamp
1st Name
2nd Name
E-mail
Tel #
Details of work,

still instead of Mailto, use send/post etc to add to DB..... I think you can dump data from a php DB straight to txt deliminated files, then upload into access..... maybe access can reach into php?

ok, re-read his orignal post, and yep, I guess that I missed that part
*oops*
well, why not php it? set up a simple DB, single table, contains;
D&T stamp
1st Name
2nd Name
E-mail
Tel #
Details of work,

still instead of Mailto, use send/post etc to add to DB..... I think you can dump data from a php DB straight to txt deliminated files, then upload into access..... maybe access can reach into php?

Maybe. Either way, the hardest part is going to be getting the information from the server to the pc automagically. Once the information is on the PC (which is the goal), then it doesn't matter how you go about getting it into access. You could build an access macro to do it, or have the program do it.

He already has it coming to him in E-mail. I think the whole idea is to avoid having it sent by e-mail.... otherwise, he could leave it like it is, and strip the details into an access database... right?

Right. I like the idea of not having to mess with email, and the visitors to the site wouldn't have to deal with the warning/notification messages associated with filling out a "mailto" form. see... http://www.paulowenlewis.com/readfirst.html not to mention having to create web pages to calm down wary internet users.

Actually, if there was a way to make it so that these warning messages didn't come up in the site visitors faces, I could run it that way for a while until I learn how to do it the right way.

Thanks for all your input guys..

ok, re-read his orignal post, and yep, I guess that I missed that part
*oops*
well, why not php it? set up a simple DB, single table, contains;
D&T stamp
1st Name
2nd Name
E-mail
Tel #
Details of work,

still instead of Mailto, use send/post etc to add to DB..... I think you can dump data from a php DB straight to txt deliminated files, then upload into access..... maybe access can reach into php?

LOL - I know some HTML, a "little" javascrpt, a very little Perl, and absolutely no PHP. I'll get there; it's next on my list... I'm sure it probably the best way to do it, but if I can do it with what I know (am learning) now HTML/Perl/cgi then that's where I'm going. I've done some research/reading about PHP; it and ASP are things I know I'll use in the future, but for now I just wanna get this thing fuctional and easy (not scary) for the site visitors.

I personally prefer Perl to PHP, and I feel that CGI is the best way to go. I'm not sure if you know any VB or any thing like that (for getting the info from the server to your PC). I've already figured a fairly simple solution from getting the info to your PC. The hardest part now, is making the CGI to save the info.

Nope, no VB, but my bro-in-law is pretty good at it I think. Maybe I'll give him a shout. I think I do have an old copy of VB6 laying around here somwhere. What part would I do with VB?

Well.... I'm not 100% sure how you planned on getting the sign up information from point A (The server) To Point B (your pc), and then storing it in an access DB, But, How _I_ would go about such a task, would be to use VB.

I'm going to (can I) assume that is because your most familiar with VB(?). As I am beginning to understand, this task can apparently be accomplished any one of several different ways; Perl/cgi/PHP/VB, etc... and combinations thereof, as mentioned in previous posts here.

I have spoken to my bro-in-law and he is coming here this afternoon; we're going to sit down and go over this all from square one. He's pretty new to all of this stuff too, but he has more basic programming knowledge than I do.

I give an update later...

Let me give you a breakdown of the situation. A Web Page, Is stored on a server. A Server is a computer that is usually online all the time, and can offer some kind of connection (such as e-mail, a web page, ftp, etc). Your PC (most likely, the computer you are reading this post from), DOES NOT (unless you are really hosting your own web server), have your web page files stored on it (and if so, probably not the ones that people are viewing). Now, This web server (the computer that has your web pages on it), can run programs. You can create programs, that run on that computer, but have no effect on the computer you are surfing with right now. The computer (the server) that is hosting your web pages, probably is running unix of some kind. Perl, is a programming language, that comes with unix. PHP, is a programming language (well, it's an HTML Preprocessor, but to avoid confusion) that can be installed on the server to offer you that ability. CGI, stands for common gateway interface. This can, ultimately, be programmed in any language, that the server (the one that is storing and running your web page) understands and accepts. These "Server Side Programming" Languages, affect your web site. They can read information from the web page, and do a great number of things with it. They can store it in a file (ON THE SERVER [The one that is hosting your page]), send it to you in an e-mail, or any other creative idea's that come along..... the key here, is that they do it all on the server. So, Joe Someguy wants your service.... the server spits out your page to him. He sees it. He signs up. He clicks "submit". Your "Server Side Program" (be it, Perl, PHP, Bash, C, whatever the server understands), accepts the information that joe put in to the page, and saves it to a file. This is great! Joe SomeGuy Just signed up, and his information is stored in a file!!! That file is on the server (the computer that is hosting your page). That Means, It's Not on your PC, and certainly Not in an Access Database.

Now, Visual Basic (VB), is a programming language that runs in windows. When you make a program with it, it will only run in windows (for the sake of simplicity). Now, I'm guessing (since they offer CGI) that the server is NOT windows. So, VB will NOT run on the server. It will only run on your windows PC. That's easy enough. So the breakdown is: Perl and PHP are "server side." They process the web page, and save the data in a file on the server. Visual Basic can run on your windows PC (Most likely, Perl and PHP Can not). So Far, So Good.

Now, We Still Have A Problem. Joe still wants the service... and as far as I know, you know nothing about it, because the CGI saved his information in a file On The Server. It didn't e-mail you anything, it didn't send an IM to you.... it just simply made a file on the server. Now, it's your duty to get that file, know that the information in it is a new signup (or service or whatever), bring that information to your PC, Save It in your access database, and act accordingly (to whatever Joe wants). Well, How do you plan to go about doing that? Visual basic.

You create a program in VB, that connects to the server, says "hey server, I need the information from the web page." It will send that information To VB, who gets that information, alerts you somehow (sound, a message box, whatever), and saves the new information into the access database. Now all you have to do, is contact Joe and provide the service. I know this is a little chaotic... so, does that help to give you a better understanding of the breakdown?

Was thinking... can't you get FTP that automatically connects and transfers data from A to B... why not just use that for the moment....set it to periodically retreive what you need from teh server.

While that is an awesome idea, not unless you use something like cute or wsftp. With those, I'm not even sure that you can make them do it... I know that the ftp system that come with Windows don't offer you such an option, and what he needs done is very simple. So downloading a whole package like wsftp is going to take more Ram, and hard-drive space than is really necessary for such a simple task. All of the automatic FTP downloaders that I have seen are trial versions, and may also come up with splashscreens and other annoyances.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.