ASP Hosting Help!

  • SigmaSquared
  • Novice
  • Novice
  • SigmaSquared
  • Posts: 23

Post 3+ Months Ago

Hi guys,

I'm completely new to ASP. I'm actually looking for some help hosting a particular asp page on my website. I'm creating a Feedback Form that will automatically send an e-mail to my inbox when someone posts feedback. Here is the code modified (i believe) for my need:

Code: [ Select ]
<%
'==========================================================
'       Codefixer's Feedback Form
'http://www.codefixer.com/codesnippets/feedbackform.asp
'You may wish to add client side and server side validation
'==========================================================
%>
<html>
<head>
<title>Feedback Form</title>
</head>
<body bgcolor="#FFFFFF">
<%
If Request.Form="" Then %>
<form method="post" action="feedback.asp" name="form1">
<div align="center">Send us your Feedback.<br>
<br>
</div>
<div align="center">
<table width="75%" border="0">
<tr>
<td>Name</td>
<td>
<input type="text" name="txtName">
</td>
</tr>
<tr>
<td>E-mail</td>
<td>
<input type="text" name="txtEmail">
</td>
</tr>
<tr>
<td>Comment</td>
<td>
<textarea name="txtFeedback" cols="40" rows="7"></textarea>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset">
</td>
</tr>
</table>
</div>
</form>
<br>
<%
Else

'receive the form values
Dim sName, sEmail, sFeedback
sName=Request.Form("txtName")
sEmail=Request.Form("txtEmail")
sFeedback=Request.Form("txtFeedback")

' create the HTML formatted email text
Dim sEmailText
sEmailText = sEmailText & "<html>"
sEmailText = sEmailText & "<head>"
sEmailText = sEmailText & "<title>HTML Email</title>"
sEmailText = sEmailText & "</head>"
sEmailText = sEmailText & "<body>"
sEmailText = sEmailText & "<font color='#00000' size='2' face='Verdana'>"
sEmailText = sEmailText & "Feedback message from: " & sName & "<br>"
sEmailText = sEmailText & "Message:" & sFeedback & "<br>"
sEmailText = sEmailText & "Date & Time:" & Now() & "<br>"
sEmailText = sEmailText & "IP :" & Request.ServerVariables("REMOTE_ADDR")
sEmailText = sEmailText & "</font>"
sEmailText = sEmailText & "</body>"
sEmailText = sEmailText & "</html>"


'create the mail object
Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
NewMailObj.From=sEmail 'This is the email of the feedback sender
NewMailObj.To = "rkhetia@gmail.com" 'change to your address
NewMailObj.Subject = "Feedback"
NewMailObj.Body = sEmailText
'you need to add these 2 lines for the mail to be sent in HTML format
'remove them and the email will be sent in Text format
NewMailObj.BodyFormat = 0
NewMailObj.MailFormat = 0
NewMailObj.Send
Set NewMailObj=Nothing

Response.write "<div align='center'>Thank you for sending your feedback.<br>"
Response.write "We will get back to you if necessary.</div>"
End If
%>
</body>
</html>
  1. <%
  2. '==========================================================
  3. '       Codefixer's Feedback Form
  4. 'http://www.codefixer.com/codesnippets/feedbackform.asp
  5. 'You may wish to add client side and server side validation
  6. '==========================================================
  7. %>
  8. <html>
  9. <head>
  10. <title>Feedback Form</title>
  11. </head>
  12. <body bgcolor="#FFFFFF">
  13. <%
  14. If Request.Form="" Then %>
  15. <form method="post" action="feedback.asp" name="form1">
  16. <div align="center">Send us your Feedback.<br>
  17. <br>
  18. </div>
  19. <div align="center">
  20. <table width="75%" border="0">
  21. <tr>
  22. <td>Name</td>
  23. <td>
  24. <input type="text" name="txtName">
  25. </td>
  26. </tr>
  27. <tr>
  28. <td>E-mail</td>
  29. <td>
  30. <input type="text" name="txtEmail">
  31. </td>
  32. </tr>
  33. <tr>
  34. <td>Comment</td>
  35. <td>
  36. <textarea name="txtFeedback" cols="40" rows="7"></textarea>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td>&nbsp;</td>
  41. <td>&nbsp;</td>
  42. </tr>
  43. <tr>
  44. <td>&nbsp;</td>
  45. <td>
  46. <input type="submit" name="Submit" value="Submit">
  47. <input type="reset" name="Reset" value="Reset">
  48. </td>
  49. </tr>
  50. </table>
  51. </div>
  52. </form>
  53. <br>
  54. <%
  55. Else
  56. 'receive the form values
  57. Dim sName, sEmail, sFeedback
  58. sName=Request.Form("txtName")
  59. sEmail=Request.Form("txtEmail")
  60. sFeedback=Request.Form("txtFeedback")
  61. ' create the HTML formatted email text
  62. Dim sEmailText
  63. sEmailText = sEmailText & "<html>"
  64. sEmailText = sEmailText & "<head>"
  65. sEmailText = sEmailText & "<title>HTML Email</title>"
  66. sEmailText = sEmailText & "</head>"
  67. sEmailText = sEmailText & "<body>"
  68. sEmailText = sEmailText & "<font color='#00000' size='2' face='Verdana'>"
  69. sEmailText = sEmailText & "Feedback message from: " & sName & "<br>"
  70. sEmailText = sEmailText & "Message:" & sFeedback & "<br>"
  71. sEmailText = sEmailText & "Date & Time:" & Now() & "<br>"
  72. sEmailText = sEmailText & "IP :" & Request.ServerVariables("REMOTE_ADDR")
  73. sEmailText = sEmailText & "</font>"
  74. sEmailText = sEmailText & "</body>"
  75. sEmailText = sEmailText & "</html>"
  76. 'create the mail object
  77. Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
  78. NewMailObj.From=sEmail 'This is the email of the feedback sender
  79. NewMailObj.To = "rkhetia@gmail.com" 'change to your address
  80. NewMailObj.Subject = "Feedback"
  81. NewMailObj.Body = sEmailText
  82. 'you need to add these 2 lines for the mail to be sent in HTML format
  83. 'remove them and the email will be sent in Text format
  84. NewMailObj.BodyFormat = 0
  85. NewMailObj.MailFormat = 0
  86. NewMailObj.Send
  87. Set NewMailObj=Nothing
  88. Response.write "<div align='center'>Thank you for sending your feedback.<br>"
  89. Response.write "We will get back to you if necessary.</div>"
  90. End If
  91. %>
  92. </body>
  93. </html>


However, when i upload this file onto my webpage, the actual code shows up!! Check it out.. What is the issue??

Please help an asp n00b!
  • omirix
  • Banned
  • Banned
  • User avatar
  • Posts: 129
  • Loc: 127.0.0.1

Post 3+ Months Ago

are you sure its an asp host?
or are you using a linux box ;)
  • SigmaSquared
  • Novice
  • Novice
  • SigmaSquared
  • Posts: 23

Post 3+ Months Ago

Hmm.. since i don't know what a linux box is, i'm probably not using that. :) And whether its an asp host... i'm not too sure about that either. I'm using these folks for hosting my free webpage: http://www.100webspace.com/

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 111 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.