Even more help - sending user options

Techy Geek

Daemon Poster
Messages
1,320
My inadequacy at making websites is shown again :(
I'm trying to make a order form, so the users can select what they want with check boxes buttons, and I want the submit button to send what choices they have made to a certain email address. I have managed to insert the check boxes, submit and reset buttons. But I cannot make it send the information, can anyone help

many many thanks in advance
 
just a quick request...
when you are asking for help like this it's useful to include the server setup...
Now I remember from another post that you have an ASP account...

to send email using asp you use the object cdonts...

unforunatly your sever host doesn't support sending emails,

http://www.1asphost.com/faqs.asp?q=74

sorry.
 
you can use a mail to link...
in which case it'd open up a mail client on their computer (not ideal).

or you can store the information in a database on your site and check it periodically, (not ideal if you don't get much traffic)...

or you could swap to a host that does allow use of mail servers.
 
that was quick, I choose the second option, I need to use that host, for .asp support, and some other stuff I've installed on it

Could anyone tell me how to store the information on a database?

Thanks root, I bet you get annoyed with loads of n00b questions, but I am hopeless at doing websites, but I get £100 for this one, so I couldn't turn it down :D
 
Sorry, I'm an absolute n00b when building sites, could you give me some code, and I'm useless at doing databases, so some help would be useful there as well.
 
of course... this example is a simple webform to take demographics. What number of males/females like your site...

use this form.
form.html
Code:
<html>
<body>
<form action=submit.asp method=get>
Name : <input type="text" name="name" /><br/>
gender : <input type="radio" name="gender" value="male" />Male, <input type="radio" name="gender" value="female" />Female<br/>
good site? :<input type="checkbox" name="site" value="good" /><br />
<input type="submit" value="submit results" />
</form>
</body>
</html>
when the user submits this page saves it.

submit.asp
Code:
<%
dim Conn, RS
dim name, gender, site

name = request.querystring("name")
gender = request.querystring("gender")
site = request.querystring("site")

DSNStatement = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
DSNStatement = DSNStatement & Server.MapPath("/USERNAME/database/mydatabase.mdb")
Conn.Open DSNStatement


RS.AddNew "Name", Name  'Make a new record and set the first field
RS.Update    'Update it to make sure it is the current record
RS.Fields("gender").Value = gender   'Set the other fields
PS.Fields("site").Value = site
RS.Update    'Save the changes by calling update again 

RS.Close
Conn.Close 

%>Your details have been saved.


after yuo have a few users you can view your result with this page...
view.asp
Code:
<%
dim Conn, RS
dim name, gender, site

name = request.querystring("name")
gender = request.querystring("gender")
site = request.querystring("site")

DSNStatement = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
DSNStatement = DSNStatement & Server.MapPath("/USERNAME/database/mydatabase.mdb")
Conn.Open DSNStatement

SQLStatement = "SELECT * FROM questionnaire "
RS.Open SQLStatement, Conn, 3, 3

reponse.write("<table><tr><th>name</th><th>gender</th><th>likes site?</th></tr>")

Do While Not rsInfo.EOF
response.write("<tr>")
          'do something with the current record.
	  respnose.write("<td>")
          Response.Write(rsInfo("name"))
	  respnose.write("</td>")
	  respnose.write("<td>")
          Response.Write(rsInfo("gender"))
	  respnose.write("</td>")
	  respnose.write("<td>")
          Response.Write(rsInfo("site"))
	  respnose.write("</td>")
          rsInfo.MoveNext
response.write("</tr>")
       Loop
response.write("</table>>")

RS.Close
Conn.Close 

%>


I've not tested it, and it's all from the top of my head... I had a quick look at how your host does things for stuff like the database path...

I'm sure in my mind something is wrong with it... (It's been ages since I used ASP, since then I've been using ASPX with SQL databases, and of course the mighty mighty PHP!!!).
 
wow, thats great I love you root (in a non-homosexual manner, obviously)

I shall report on my findings :D
 
it sorta works, well, look for yourself....http://g.1asphost.com/rhphoto/form.html, the male button doesn't work, do I need to make a database, because I've never understood those properly, if so, would you mind awfully making it yourself and email it to me. But its great so far.
I would give you loads of rep points, but it won't let me

Sorry to double post :(
 
Back
Top Bottom