954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with asp form will not display contact information

Please enter your contact information below



Please enter your full name:


Please enter address:


Please enter your city,state and zip.
Please enter your phone number with area code.

jchamel
Newbie Poster
7 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

OK everything is good with your code. The reason you are not seeing any output from the form submission on your asp page is because you are not using any code to display the information.

Try using this code sample for your asp page:

<html>
<head>
<title> asp page</title>
</head>
<body>
<h1> Here is your contact information</h1>
<% 
'// declare variable names to hold the form field values
Dim strfullname, straddress, strcitystatezip, strphone
'// assign values to the declared variables
strfullname = Request.Form("fullname")
straddress = Request.Form("address")
strcitystatezip = Request.Form("citystatezip")
strphone = Request.Form("phone")
%>
<!-- Now display the results from the form submission using the above variables -->
Your Name : <%=strfullname%>
Your Address : <%=straddress%>
Your Address : <%=strcitystatezip%>
Your Phone : <%=strphone%>
</body>
</html>
Lafinboy
Junior Poster
172 posts since Jul 2004
Reputation Points: 16
Solved Threads: 7
 

Thanks so much. I looked at that code so much, I never noticed that I didn't tell it what to display. My teacher told me another way to do this was response.write ("full name") etc, under the request.form. I was requesting but not telling it what to do huh. This is only my second asp file. Thanks so much. What book did you learn from? We are using Begining active server pages by several authors and the company wrox. :D

jchamel
Newbie Poster
7 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Happy to help.

<%=variablename%> is a shorthand way of writing <%Response.Write variablename%>

I started with the same book, then hit the forums and searched google to fill in the gaps and expand my knowledge. Another book I always keep nearby is VBScript in a Nutshell published by O'Reilly. It's a quick reference to the language and it's use, like a dictionary. Really useful when you need to check the use/syntax of a function.

Good luck with your learning. And keep asking questions - it's the best way to learn.

Lafinboy
Junior Poster
172 posts since Jul 2004
Reputation Points: 16
Solved Threads: 7
 

Hi all.. This is my first time to this forum and i must say very impressive work here, But i need some serious help with a problem i have with the topic overhead here.

I have used the code along side more code. find the code below,

<% Name = Request.Form("name") SenderEmail = Request.Form("email") Subject = "Regarding " & Request.Form("subject") Recipient = Request.Form("priority") Body = Request.Form("body")

Set JMail = Server.CreateObject("JMail.SMTPMail")

' Below you should enter your own SMTP-server JMail.ServerAddress = "I Have it set, But i am not displaying, Sure you will understand"

JMail.Sender = Senderemail JMail.Subject = Subject

JMail.AddRecipient "I Have it set, But i am not displaying, Sure you will understand"

JMail.Body = Body

JMail.Priority = 3

JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR") JMail.Logging = True JMail.Execute

'// declare variable names to hold the form field values Dim strname, stremail, strcountry, strbody, strsubject, strabout, strto, strhomepage, strpriority '// assign values to the declared variables strname = Request.Form("name") stremail = Request.Form("email") strcountry = Request.Form("country") strbody = Request.Form("body") strsubject = Request.Form("subject") strabout = Request.Form("about") strto = Request.Form("to") strhomepage = Request.Form("website") strpriority = Request.Form("priority")

%>

Message To : <%=strto%>
Subject : <%=strsubject%>
Full Name : <%=strname%>
Email Address : <%=stremail%>
Country : <%=strcountry%>
Homepage : <%=strhomepage%>
Where did you hear about us : <%=strabout%>
Message Priority : <%=strpriority%>
Mail Message : <%=strbody%>

Now, The information is been displayed when you submit the form,

Preview here : www.DIRTYRATSCLAN.com/contact.htm

It is also sending the email to my account with no flaw, The problem i am having is that the email is not stating all fields of the form. It is just giving the Email address and subject, I need all the area's for instance, Website & Priority..

I would appreciate immediate help with this issue as i have been up 17 hours :(

This is my first time working with .asp coding so please take that into account..

Kind Regards,
Sinister747

sinister747
Newbie Poster
14 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

The reason you are only getting the value of the form field is because that is the only field you are including in your email. I would modify your code a bit so the form field data is collected before you process the email, and you can then merge the form fields into a layout that is suitable for you, something along the lines of:

<%
Recipient = Request.Form("priority")

'// declare variable names to hold the form field values
Dim strname, stremail, strcountry, strbody, strsubject, strabout, strto, strhomepage, strpriority
'// assign values to the declared variables
strname = Request.Form("name")
stremail = Request.Form("email")
strcountry = Request.Form("country")
strbody = Request.Form("body")
strsubject = Request.Form("subject")
strabout = Request.Form("about")
strto = Request.Form("to")
strhomepage = Request.Form("website")
strpriority = Request.Form("priority")

'// now build the form content into a single variable
dim strEmailBody
strEmailBody = "From: " & strname & VbCrLf
strEmailBody = strEmailBody & "Email: " & stremail  & VbCrLf
strEmailBody = strEmailBody & "Country: " & stremail & VbCrLf
'// etc, etc, you get the picture by  now

Set JMail = Server.CreateObject("JMail.SMTPMail")

' Below you should enter your own SMTP-server
JMail.ServerAddress = "I Have it set, But i am not displaying, Sure you will understand"

JMail.Sender = stremail
JMail.Subject = strsubject

JMail.AddRecipient "I Have it set, But i am not displaying, Sure you will understand"

JMail.Body = strEmailBody

JMail.Priority = 3

JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.Logging = True
JMail.Execute
%>
Lafinboy
Junior Poster
172 posts since Jul 2004
Reputation Points: 16
Solved Threads: 7
 

Greatly appreciated and nice fast reply, Thank you very much. If i have any problems i will post back, However it seems very simple :rolleyes:

:confused: cya

sinister747
Newbie Poster
14 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

Well i will be damned.. Would you look at that. You's guys are ACE !.. keep up the good work and thank you SO SO SO Much !

On Part of DIRTY RATS CLAN and myself personelly thank you's

sinister747
Newbie Poster
14 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

No worries:D

Lafinboy
Junior Poster
172 posts since Jul 2004
Reputation Points: 16
Solved Threads: 7
 

" & vbCrLf _
& " Dear " & strusername & vbCrLf _
& "You are receiving this receipt due to a recent update to your Monthly Subscription Fee." & vbCrLf _
& "Please find your receipt below;" & vbCrLf _
& " -----------------------------------------------------------------------------------" & vbCrLf _
& " Our Referance No : " & strID & vbCrLf _
& " Name: " & strname & vbCrLf _
& " Username: " & strusername & vbCrLf _
& " Item Title: Dirty Rats Clan - Monthly Subscription Fee " & vbCrLf _
& " ----------------------------------------------------------------------------------- " & vbCrLf _
& " Invoice Payment Date: " & vbCrLf _
& " Payment Cover Till: " & vbCrLf _
& " ----------------------------------------------------------------------------------- " & vbCrLf _
& " >> Amount Sent: " & stramount & vbCrLf _
& " >> Transfer Fee: " & strpaypalfee & vbCrLf _
& " >> Total Received: " & stramountreceived & vbCrLf _
& " ----------------------------------------------------------------------------------- " & vbCrLf _
& " " & vbCrLf _
& " This message (including any attachments) is confidential and may be " & vbCrLf _
& " legally privileged. If you are not the intended recipient, you should " & vbCrLf _
& " not disclose, copy or use any part of it - please delete all copies " & vbCrLf _
& " immediately and notify DIRTY RATS CLAN on [email]FalseEmail@Dirtyratsclan.com[/email] " & vbCrLf _
& "


" & vbCrLf _
& " " & vbCrLf _
& " Any information, statements or opinions contained in this message " & vbCrLf _
& " (including any attachments) are given by the author. They are not " & vbCrLf _
& " given on behalf of DIRTY RATS CLAN unless subsequently confirmed by an individual " & vbCrLf _
& " other than the author who is duly authorised to represent DIRTY RATS CLAN. " & vbCrLf _
& "


" & vbCrLf _
& " DIRTY RATS CLAN is registered in the Republic of Ireland & United Kingdom." & vbCrLf _
& "

sinister747
Newbie Poster
14 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You