Click to See Complete Forum and Search --> : Forms
Joachim
09-11-2005, 06:03 PM
Hey,
I just started learning how to create a propper website, ans I'm already stuck.
I want to make forms on my site to give people the change to tell me what they think, are to get information. I can write the code for the form, but now my question is how I can store the information from the form on my server, and if it is possible with asp?
Thank You
Joachim :confused:
buntine
09-11-2005, 09:13 PM
Yeh, it is definately possible. You have a few options:
- Email the contents of the form to yourself.
- Store the data in a database, textfile, XML file, etc
The process differs depending on which method of data storage appeals to you more.
Rather than detailing both, what would you rather?
Regards.
Joachim
09-12-2005, 05:01 AM
I would prefer a simple text file...
Thank you for answer
Joachim
Joachim
09-12-2005, 05:03 AM
I would prefer a simpel text file...
Thanks for your answer
Joachim :)
buntine
09-12-2005, 06:35 AM
Alrighty. Using a databse or XML file would probably be more efficient as they have explicit API's for data storage and retrieval, though. :p
You will need to use the FSO object. That is, the File System Object. Something like the following should help you out:
Dim objFso, objFile, strComments
Const FOR_APPENDING = 3
Set objFso = CreateObject("Scripting. FileSystemObject")
Set objFile = objFso.OpenTextFile(Server.MapPath("\a\virtual\path\comments.txt"), FOR_APPENDING, True)
strComments = Request.Form("comments")
objFile.WriteLine strComments & VbCrLf
This is not a complete solution. You may also want to have some page that extracts and organizes the data. At the moment it will simply append the data to the end of the text file.
The following reference will be helpful, also: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/sgworkingwithfiles.asp
Regards.
Joachim
09-12-2005, 06:49 AM
Thank you very much
buntine
09-12-2005, 07:46 AM
Don't hesitate to come back if you run into troubles.