• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Basic website

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a basic website which is static now. I would like to add two forms - a guest registration form and a contact me form. I am not a programmer of any language but know HTML and some javascript. I request some help about what I should to capture the user data and send it by email.

(I would like to eventually create a database and store the details directly in some tables- suggest some ideas on how I can do that also).

Thanks in advance.


Deepika
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need a server side language and a database. If you do not want to go that route, then you can look online for free guestbooks.

Eric
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

I'm having trouble figuring this out too and have been stuck. Do you have an suggestions on where i can get sample code for this?

Mimo
 
Mimo Mimo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<form method=post action="MAILTO:abc@a.com">

doesn't seem to work.
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Mimo Mimo",

There aren't may rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Deepika,

If you want to learn how to do this yourself, it might help by first separating out the various parts you'll need; the ingrediants.

1) You'll need an HTML Form to collect the data.

2) You'll need a way to collect the data from the HTML Form on the server, and that means you'll need to pick a server side language: .NET, Java, PhP - take your pick. You'll typically find somewhat consistent conventions, at least with dealing with HTML requests, but in this case the most important one is an object that represents the user's request. What you want to do is read the parameters from the user request. For example, if you have a form field with a name of "guest_name", then you would want to read out the "guest_name" parameter.

3) You'll need a place to save the collected data. Here I recommend you poke around for example code on whatever language you are using and whatever database you are using. It's only a google away: for instance: ASP.NET SQL Example, or PhP MySql Example.

After you get through all three steps, you should have a better understanding of how the pieces fit together. But, before you throw anything out onto the web, be sure to do a little research on form validation, sql injection, and script injection (aka cross-site scripting) to make sure you're not opening up any security hole.
 
deepika malhotra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve. But right now I do not want to set up a database or use any server side language. All I want is capture the information that I collect from the forms ( gues form and contact us form) which should be emailed to me in proper format directly. Can I do it by just using HTML?

Thanks,

Deepika
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Can I do it by just using HTML?



No. As Eric has already correctly pointed out, in order to do server-side processing of submitted data, you need a server-side language.

I do not want to ... use any server side language



Then you cannot do this.
 
deepika malhotra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh... in that case what is the simplest way to do it? Java scares me to death. Can you please suggest the simplest way possible?

Thanks in advance,

D
 
deepika malhotra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric,

Thanks. Can I do without a database at all? All I want is to be able to send the form information to be emailed.I do not want it to be saved anywhere.


Thanks a lot for your time.

Deepika
 
deepika malhotra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody please suggest a website or a tutorial where I can pick up the stuff I need for this? I understood that I do not need all my other pages to be in jsps and can leave them as HTMLs. I am planning to change the two htmls (guest and contact forms) to jsps. I would like to know how I can avoid a database setup. I really appreciate if someone can show me preferably with an example how the values from the form can be saved to a temperary file from which the values whould be extracted and send by email. Do I need another technology to send an email ?
 
deepika malhotra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am changing the HTMLs to JSPs. I only need to now know how I can send the form information in an emal. Appreciate if someone can point me in the right direction.


Thanks,

D
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not need to change the HTML pages that contain the forms to JSPs. That will serve no purpose at all.

What you need is a server-side component that these forms will submit to that will perform the email processing for you. No database necessary just to send emails.

If you decide to use Java and a servlet engine, then a servlet that uses the JavaMail API is what you need.

If you'd like to avoid Java -- which for sending a simple mail message is quite a bit of overkill -- you can use any other server-side technology: CGI with Perl, for example. I'm willing to bet there are hundreds, if not thousands, of such Perl scripts floating around the net.

If you want to get a database involved, then servlets with JDBC is what I'd recommend, though there are other alternatives depending upon what technologies you want to get involved with.
[ November 28, 2005: Message edited by: Bear Bibeault ]
 
deepika malhotra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much Bear. I will learn the language soon but for now if I need not use java I don't want to use it. No database either.

Here is what I understand. I will only need a perl script on the server side to which I will submit my forms which will then compose an email with the form data and send the email. I do not need any java to do that.


-D
 
Bear Bibeault
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is correct. The web server you use must have Perl CGI enabled, but I'm sure you can find out about that on the web very easily.
 
deepika malhotra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much Bear.
 
All of the following truths are shameless lies. But what about this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic