Discussion
Firstly, I'm a beginner, have NO clue what I'm doing, but I need a form.
I'm building a website for a friends business and I'm trying to get a form set up so people can request info about the company's services.
I've knocked up a quick form in Dreamweaver but I have no clue how to make the damned thing work.
www.grahamjyoung.co.uk/formtest.htm
I'd like for the form - when submitted - to send an email to my friend with, the info they have provided in the form, Name, Email, Address etc and the subject of the mail to be determined by what they select on the drop down menu.
Anyone got any advice on what I can do?
Thanks in advance,
Graham
I'm building a website for a friends business and I'm trying to get a form set up so people can request info about the company's services.
I've knocked up a quick form in Dreamweaver but I have no clue how to make the damned thing work.
www.grahamjyoung.co.uk/formtest.htm
I'd like for the form - when submitted - to send an email to my friend with, the info they have provided in the form, Name, Email, Address etc and the subject of the mail to be determined by what they select on the drop down menu.
Anyone got any advice on what I can do?
Thanks in advance,
Graham
Two things you can do.
Can you execute script on the server? Traditionally the data they enter on the form is sent to the back end server when they press the submit button.
The bit you need to deal with (if you look at the HTML) is in the FORM tag.
<FORM id=form1 name=form1 method=post action="">
<input id=textfield1 name=textfield1 value="">
</FORM>
You would change the 'action=""' tag to point to a .ASP or .PHP script file in which you can usually get to the value in textfield1 somehow - you'll need to read a book...
If you can't execute scripts on the back end server you will need to do something else. I haven't done this personally but I believe you can have that 'action=""' tag have something like "mailto:graham@graham.co.uk" in it whereupon if the end user has a mail program on their PC it will generate an e-mail they can send if they want to...
And its not Java you'll be using but good old-fashioned HTML and possibly some JavaScript (quite different).
Can you execute script on the server? Traditionally the data they enter on the form is sent to the back end server when they press the submit button.
The bit you need to deal with (if you look at the HTML) is in the FORM tag.
<FORM id=form1 name=form1 method=post action="">
<input id=textfield1 name=textfield1 value="">
</FORM>
You would change the 'action=""' tag to point to a .ASP or .PHP script file in which you can usually get to the value in textfield1 somehow - you'll need to read a book...
If you can't execute scripts on the back end server you will need to do something else. I haven't done this personally but I believe you can have that 'action=""' tag have something like "mailto:graham@graham.co.uk" in it whereupon if the end user has a mail program on their PC it will generate an e-mail they can send if they want to...
And its not Java you'll be using but good old-fashioned HTML and possibly some JavaScript (quite different).
Don said:Generally speaking the contents of the form will go back to the web server for processing as part of a GET or POST submission. What you do with it when it gets there is the choice you have to make. I don't know about the microsoft options such as PHP etc but ones I've used are CGI (you write a script on the server in C, shell-script, perl etc which handles the post) or you can write a servlet in java either from scratch or using a framework such as struts. The complexity to do this is several order of magnitude greater than writing some HTML by hand and a million miles away from building a page in dreamweaver. That's not to say you couldn't learn but it would be a steep curve if you've done no OO design/coding.
And its not Java you'll be using but good old-fashioned HTML and possibly some JavaScript (quite different).
Alternatively you could catch the user pressing the submit button client side (before it leaves the browser effectively) with some javascript (looks a bit like java but isn't java and runs in the browser). If you can get javascript to send an email then you may be able to solve your problem this way. However, to send an email you need to access an smtp server and given that this bit of script would be running on the client and each client would not necessarily be able to access your prefered smtp server this may not work.
The third option is that some service providers (I assume you will be hosting this on a service provider website rather than your clients own machine) provide cgi scripts for you which do exactly what you want. I know Demon used when they hosted my webspace. You'd just follow their instructions on how to configure the form, usually with a hidden field containing the email address to send the form contents to, and theit script would take car of the rest and email the contents of the form in a name/value format to the specified email address.
If you are hosting this on an ISPs machine they may well have limitation on which type of technology you can deploy there. They may allow you to deploy CGIs and not servlets for example.
If you host on your clients machine you won't have these retrictions and you may well be able to find a prewritten cgi for email script ready written that you can use (or something written in the microsoft alternatives).
Please feel free to ask any more question and I'll help if I can. My recent knowledge is limited to Java Servlets and Struts based implementations though (basically that's my job) but I'll do my best.
Regards,
Mark
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


