Form results

liunx

Guest
Results from a form using the post method and sending the result via e-mail replace special characters in the form with hex versions (i.e. %28 for ( and %3A for : and many more...). Is there any way to avoid this or is there a script to convert the output of the form? <br />
<br />
Great site btw. I know I'll be be here a lot.<!--content-->that is not hex versions of those, that is the ascii version of it. and it all depends on how you send the email. are you using a preconfigured script or something? also what language are you using (php, cgi, asp)<!--content-->Appologies for the lack of info. I'm using ASP and a mailer.asp that someone got from a 3rd party. Here's the mailer:<br />
<br />
"<table border="0" width="580"><br />
<tr><td><br />
<br />
<%<br />
Dim FromEmail<br />
Dim CheckEmailo<br />
Dim CheckEmailx<br />
Dim jilm<br />
Dim buildmail<br />
Dim objSMTP<br />
<br />
<br />
<br />
FromEmail = TRIM(Request.Form("fromemail"))<br />
If FromEmail = "" Then<br />
FromEmail = "webmaster@???????.com"<br />
Else<br />
CheckEmailx = Instr(FromEmail,"@")<br />
CheckEmailo = Instr(FromEmail,".")<br />
If CheckEmailx = 0 OR CheckEmailo = 0 Then<br />
FromEmail = "webmaster@???????"<br />
Else<br />
FromEmail = Request.Form("fromemail")<br />
End If<br />
End If<br />
<br />
jilm = Request.Form<br />
<br />
jilm = REPLACE(jilm, "+", " ")<br />
jilm = REPLACE(jilm, "&" , vbCrLf & vbCrLf )<br />
jilm = REPLACE(jilm, "=" , " : " & vbTab & vbTab)<br />
<br />
buildmail = vbCrLf & vbCrLf<br />
buildmail = buildmail & Request.Form("Subject") & vbCrLf<br />
buildmail = buildmail & "Date: " & FormatDateTime(Date,vbLongDate) & vbCrLf<br />
buildmail = buildmail & "**************************************************" & vbCrLf & vbCrLf<br />
buildmail = buildmail & jilm<br />
<br />
'Set objSMTP = Server.CreateObject( "GCSMTP.GCSMTP.1" )<br />
'objSMTP.SMTPServer = "???????.???????.com"<br />
'objSMTP.LocalDomain = "???????.com"<br />
'objSMTP.From = FromEmail<br />
'objSMTP.To = Request.Form("mailto")<br />
'objSMTP.FromName = Request.Form("fromName")<br />
'objSMTP.ToName = "???????"<br />
'objSMTP.Subject = Request.Form("Subject")<br />
'objSMTP.Message = buildmail<br />
'If objSMTP.SendMessage then<br />
<br />
Dim objSendMail<br />
Set objSendMail = Server.CreateObject("CDONTS.NewMail")<br />
objSendMail.From=FromEmail<br />
objSendMail.To=Request.Form("mailto")<br />
objSendMail.Subject=Request.Form("Subject")<br />
objSendMail.Body=buildmail<br />
objSendMail.Send<br />
Set objMail=Nothing<br />
<br />
%><br><br><br />
<br />
<br />
<br />
<br />
<br />
<%If Request.Form("formResp") <> "" Then %><br />
<%= Request.Form("formResp") %><%<br />
Else %><br />
We have received your correspondence.<%<br />
End If %><BR><BR><BR><br />
<br />
<br />
<br />
</td></tr><br />
</table>"<br />
<br />
I inherited this site and am new to ASP. But now I get to "fix" it. <br />
<br />
Thanks for your help.<!--content-->I think the problem is right here<br />
<br />
jilm = REPLACE(jilm, "+", " ") <br />
jilm = REPLACE(jilm, "&" , vbCrLf & vbCrLf ) <br />
jilm = REPLACE(jilm, "=" , " : " & vbTab & vbTab) <br />
<br />
<br />
that is doing the replacing on +, &, =<br />
<br />
so try commenting those out and see if it works. they might be in there to stop people from inserting stuff in a form field that can do harm to the database and / or site.<!--content-->Nope, that just formats the e-mail so that it's more readable. It makes it pretty. <br />
<br />
Any other ideas? Or do you think I need to suggest a "find and replace" solution?<!--content-->I know squat about ASP but I did a bit of digging around on Google. I entered the following search terms convert html entities asp<br />
<br />
I followed a few links but it appeared to me the only way would be to use a REPLACE() on each of the entities. E.g.:<br />
<br />
REPLACE(text, "%28", "(")<br />
<br />
This seems a bit inefficient and so I expect someone will come along with a better solution.<!--content-->
 
Back
Top