ASP Classic - Request.Form data has no value - html

I'm new to ASP. I'm using MSWindows Server 2008 x86 6.0.6002 to make simple "PersonalInformation" page.
Even though this is pathetic, please do not downvote.
But I've got a problem that cannot get value from Request.Form data.
Implementation here on TestHtml.html & TestAsp.asp.
TestHtml.html
<html>
<title>MultiPart FormData Test</title>
<header></header>
<body>
<form action="http://10.21.56.101/Test/TestAsp.asp" method="POST" enctype="multipart/form-data" name="MPDFTest" id="MPDFTest">
Name : <input name="ST_Name" type="text" id="ST_Name"/>
Sex : <input name="ST_Sex" type="text" id="ST_Sex"/>
Age : <input name="ST_Age" type="text" id="ST_Age"/>
Height : <input name="ST_Height" type="text" id="ST_Height"/>
SData : <input name="ST_SData" type="file" id="ST_SData"/>
<input name="ST_SendInfo" type="submit" value="SaveData" id="ST_SendInfo"/>
</form>
</body>
</html>
TestAsp.asp
<%
Option Explicit
Dim miName, miSex, miAge, miHeight
miName = Request.Form("ST_Name")
miSex = Request.Form("ST_Sex")
miAge = Request.Form("ST_Age")
miHeight = Request.Form("ST_Height")
Response.Write "---- Data Check ----<br>"
Response.Write "Name : " & miName & "<br>"
Response.Write "Sex : " & miSex & "<br>"
Response.Write "Age : " & miAge & "<br>"
Response.Write "Height : " & miHeight & "<br>"
If miName = "" Or miSex = "" Or miAge = "" Or miHeight = "" Then
Response.Write "Please check Name, Sex, Age, Height again!<br>"
Else
Response.Write "Data Saved.<br>"
End If
%>
As you see, this is a simple code.
But on TestAsp.asp, it doesn't get value from Request.Form data.
I always get string "Please check Name, Sex, Age, Height again!".
Why? and What's wrong on my code?
Someone please help me. Thank you in advance.

Remove enctype="multipart/form-data"
And replace name="ST_Age to name="ST_Age", and name="ST_Height to name="ST_Height".
To upload file use aspupload or asppdf and don't forget to add enctype="multipart/form-data" at the beginning of the form

Related

Add Record to Database and Upload an Image at the same time (2nd Attempt with different code)

Having problems! I have messed with this code over and over. This is just one of my attempts. Trying to add a record to a database and upload an image at the same time. The first one I sent would add the record but, would not upload the image. This one will upload the image but, will not add the record. My patience is running out. On this one I'm getting a error saying I can't use generic requests.
<%# Language=VBScript %>
<%
option explicit
Response.Expires = -1
Server.ScriptTimeout = 600
Session.CodePage = 65001
dim uid,thisuid,bizid,sourceid,email,PTitle,uname,conn,ucomments,RelatedTo,ToMessage,imgid,sql
uid = "JIU645OIuoiUI6435OIUhouihoHI"
%>
<!-- #include file="freeaspupload.asp" -->
<%
Dim uploadsDirVar
uploadsDirVar = "c:\inetpub\wwwroot\the-website\users\" & uid & "\"
function OutputForm()
%>
<div class="w3-card w3-round w3-white">
<div class="w3-container">
<h6 class="w3-opacity">Create A Post</h6>
<form method="POST" enctype="multipart/form-data" accept-charset="utf-8" action="uploadTester.asp" onSubmit="return onSubmitForm();">
<input name="UComments" type="text" style="padding:5px;width:100%;" placeholder="Type your comments..." required>
<br><br>
<button type="submit" class="w3-btn w3-theme" value="Upload"><i class="fa fa-pencil"></i> Post</button>
<div class="photodiv w3-btn w3-theme"><i class="fa fa-image"></i> Photo<input type="file" name="attach1" class="hide_file"></button></div>
<input hidden name="sourceid" value="<%= sourceid %>">
<input hidden name="uid" value="<%= uid %>">
<input type="hidden" name="NewMess" size="20" value="Yes">
<input type="hidden" name="RelatedTo" size="20" value="0">
<input type="hidden" name="Email" value="<%= email %>">
<input type="hidden" name="TableName" value="ProWall">
<input type="hidden" name="Title" value="<%= PTitle %>">
<input type="hidden" name="ThisMessage" size="20" value="0">
<input type="hidden" name="Name" value="<%= uname %>">
</form>
</div><div> </div>
</div>
<%
end function
function TestEnvironment()
Dim fso, fileName, testFile, streamTest
TestEnvironment = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if not fso.FolderExists(uploadsDirVar) then
TestEnvironment = "<B>Folder " & uploadsDirVar & " does not exist.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
exit function
end if
fileName = uploadsDirVar & "\test.txt"
on error resume next
Set testFile = fso.CreateTextFile(fileName, true)
If Err.Number<>0 then
TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have write permissions.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
exit function
end if
Err.Clear
testFile.Close
fso.DeleteFile(fileName)
If Err.Number<>0 then
TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have delete permissions</B>, although it does have write permissions.<br>Change the permissions for IUSR_<I>computername</I> on this folder."
exit function
end if
Err.Clear
Set streamTest = Server.CreateObject("ADODB.Stream")
If Err.Number<>0 then
TestEnvironment = "<B>The ADODB object <I>Stream</I> is not available in your server.</B><br>Check the Requirements page for information about upgrading your ADODB libraries."
exit function
end if
Set streamTest = Nothing
end function
function SaveFiles
Dim Upload, fileName, fileSize, ks, i, fileKey, filedname
Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)
filedname = 1
for each fileKey in Upload.UploadedFiles.keys
if filedname = 1 then
filedname = filedname + 1
imgid = Upload.UploadedFiles(fileKey).FileName
end if
next
uid=Upload.Form("uid")
thisuid=Upload.Form("thisuid")
email=Upload.Form("email")
ucomments=Upload.Form("ucomments")
RelatedTo=Upload.Form("RelatedTo")
ToMessage=Upload.Form("ToMessage")
if ToMessage = "" then
ToMessage = 0
end if
if RelatedTo = "" then
RelatedTo = 0
End if
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=c:/inetpub/wwwroot/the-website/contents/page/MBoard.mdb"
sql="INSERT INTO ProWall (uid,sourceid,email,ucomments,posted,RelatedTo,ToMessage,imgid) VALUES ('"&uid&"','"&thisuid&"','"&email&"','"&ucomments&"','"&Now&"','"&RelatedTo&"','"&ToMessage&"','"&imgid&"';"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 2
conn.close
set conn = nothing
'response.redirect "show-msg.asp"
' If something fails inside the script, but the exception is handled
If Err.Number<>0 then Exit function
end function
%>
<HTML>
<HEAD>
<TITLE>Test Free ASP Upload 2.0</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
BODY {background-color: white;font-family:arial; font-size:12}
</style>
<script>
function onSubmitForm() {
var formDOMObj = document.frmSend;
if (formDOMObj.attach1.value == "" && formDOMObj.attach2.value == "" && formDOMObj.attach3.value == "" && formDOMObj.attach4.value == "" )
alert("Please press the Browse button and pick a file.")
else
return true;
return false;
}
</script>
</HEAD>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-blue-grey.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Open+Sans'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
html, body, h1, h2, h3, h4, h5 {font-family: Open Sans, sans-serif;}
.photodiv{
padding:8px 16px;
background:;
border:0px;
position:relative;
color:#fff;
border-radius:2px;
text-align:center;
float:left;
cursor:pointer
}
.hide_file {
position: absolute;
z-index: 1000;
opacity: 0;
cursor: pointer;
right: 0;
top: 0;
height: 100%;
font-size: 24px;
width: 100%;
}
</style>
<BODY onload="OutputForm()">
<%
Dim diagnostics
if Request.ServerVariables("REQUEST_METHOD") <> "POST" then
diagnostics = TestEnvironment()
if diagnostics<>"" then
response.write "<div style=""margin-left:20; margin-top:30; margin-right:30; margin-bottom:30;"">"
response.write diagnostics
response.write "<p>After you correct this problem, reload the page."
response.write "</div>"
else
response.write "<div style=""margin-left:150"">"
OutputForm()
response.write "</div>"
end if
else
response.write "<div style=""margin-left:150"">"
OutputForm()
response.write SaveFiles()
response.write "<br><br></div>"
end if
%>
</BODY>
</HTML>

How to display Success message after clicking Save in HTML page

I have an html form containing this code which runs on IIS:
<form action="http://server1/data.asp" method="POST">
Your Name: <input name="name" type="text">
<input value="Save" type="submit">
</form>
After user submits this form it runs the code in data.asp which displays a Success message with code to write to a text file (file1.txt):
Success!
<%
Dim fso
Dim tst
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set tst = fso.OpenTextFile("C:\Inetpub\wwwroot\data\file1.txt", 8, true)
tst.writeline "Name = " & Request.Form("name")
tst.writeline "" & Request.Form("")
tst.close
Set tst = Nothing
Set fso = Nothing
%>
This works but it just shows a page with Success! and stays there. What I'd really like is:
After user submits the form by clicking Save I'd like a little message box that says "Success" and remain on the same html page or go to a url I specify within the code.
I don't want to use Java or 3rd party extensions. This is an HTML page that runs the data.asp page on submit and I'd like it to stay that way if possible.
So how would I modify the html and/or data.asp page to do this?
You can do like this:
Response.Redirect "https://www.yoursite.com/thankyou.asp"
Instead of returning "Success!" as your response content you can return the form content you have above, this way you can use the same file for the GET and POST methods, with an condition on your asp logic to execute only on POST requests and return a success alert when the code is excuted successfully.
<form action="http://server1/index.asp" method="POST">
Your Name: <input name="name" type="text">
<input value="Save" type="submit">
</form>
<%
If (Request.Method = "POST") Then
Dim fso
Dim tst
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set tst = fso.OpenTextFile("C:\Inetpub\wwwroot\data\file1.txt", 8, true)
tst.writeline "Name = " & Request.Form("name")
tst.writeline "" & Request.Form("")
tst.close
Set tst = Nothing
Set fso = Nothing
response.write ("<script>alert('Success!');</script>")
End If
%>
Found the solution by adding an extra page to the mix (redir2form.asp):
in data.asp:
<%
Dim fso
Dim tst
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set tst = fso.OpenTextFile("C:\Inetpub\wwwroot\data\file1.txt", 8, true)
tst.writeline "Name = " & Request.Form("name")
tst.writeline "" & Request.Form("")
tst.close
Set tst = Nothing
Set fso = Nothing
%>
Response.Redirect "http://server1/redir2form.asp"
in redir2form.asp:
<%
response.write ("<script>alert('Success!');</script>")
%>
<meta http-equiv="refresh" content="1; url=http://server1/index.htm" />
Index.htm has the form action going to the data.asp page.
Not as neat as it could be but that's how I got it to work. After a user submits the form he gets the "Success!" message box and once they click OK they're redirected back to the form page.

Calling a vbscript funciton to update a SQL table from an HTML form generated on an asp-classic page

Having a hard time with updating a SQL table from an HTML form generated on an asp-classic page. The page dynamically creates a table based on a SQL query; I've added a form for the purpose of editing certain fields displayed in the table but have been unable to trigger the function (i.e. onclick) that the form button calls using the code below. I've tried multiple variations of the syntax used for calling the function via VBscript and am missing something entirely. I'm wondering if I'm trying something that can't be done in the asp-classic environment due to the server side code being used and the limitations that go with that (as well as my trying to use the same page to generate the results). I know the default behavior for the form is to refresh the page if I don't specify a different page. In the code below, I'm just trying to confirm the behavior before I add the SQL update statement to the function. (I'm typically only retrieving or inserting data for a web site - very little experience updating the data between a single page like this.)
<br>
<form method="POST" id="form" action="">
<table>
<tr>
<td>
<select name="state">
<%
'populate the dropdown selection for the state within the form
do until rs.eof
For each x in rs.fields
response.write "<option value=" & x.Value & ">" & x.Value & "</option>" & vbNewLine
next
rs.movenext
loop
%>
</select>
</td>
<td>
<select name="ps">
<option value="blank"></option>
<option value="prime">Primary</option>
<option value="secondary">Secondary</option>
</select>
</td>
<td>
<input name="emp_num" size="5" maxlength="5" rows="1" ></textarea>
</td>
<td>
<input type="submit" onclick="Go" value="Update record"/>
</td>
</tr>
</table>
</form>
<%
function Go() {
msgbox "test"
//additional SQL code would be included here once the function actually works
}
%>
<%
'close the DB connection
dbconn.close
%>
</body>
</html>
You're trying to mix server-side code with client-side code, and It Don't Work Like ThatTM.
Here's a very rough outline of how you could get information from the user, process it, and display it, all on the same asp page. Note the utter lack of JavaScript. :)
<html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="css/stylestuff.css">
<%
Dim rs, sql, conn
Dim mylist, myval1, myval2, i
myval1 = Request.Form("val1")
myval2 = Request.Form("val2")
'- If the form hasn't been submitted yet, myval1&2 will be the special value Empty,
'- but you can treat them as a blank string ("") for all intents and purposes.
If Validate(myval1, myval2) = True and myval1 & myval2 <> "" Then
DoStuffWith myval1, myval2
End If
%>
</head>
<body>
<h1>My Page</h1>
<form method="post" action="">
<p>Select one: <select name="val1" size="1">
<%
ListStuff mylist
For i = 0 to UBound(mylist,1)
response.write "<option value='" & mylist(0,i) & "'"
If myval & "" = mylist(0,i) & "" Then response.write " selected"
response.write ">" & mylist(1,i) & "</option>"
Next
%>
</select></p>
<p>Write something here:
<input type="text" name="val2" value="<%=myval2%>" size="10"></p>
<p><input type="submit" name="btn" value="Submit"></p>
</form>
<%
If myval1 & myval2 <> "" Then
DisplayStuff myval1, myval2
End If
%>
</body>
</html>
<%
Sub ListStuff(L)
sql = "Select [...] From [...] Where [...]"
Set rs = Server.Createobject("ADODB.Recordset")
rs.Open sql, "connection string (or previously-opened connection object)", 1,2
If Not rs.EOF Then
L = rs.GetRows
Else
Redim L(1,0)
L(0,0) = 0 : L(1,0) = "missing!"
End If
rs.Close
Set rs = Nothing
End Sub
'---------------------------------
Function Validate(v1,v2)
dim f
f = True
If Not Isnumeric(v1) Then f = False
If Len(v2) > 10 Then f = False
Validate = f
End Function
'---------------------------------
Sub DoStuffWith(v1,v2)
'- table-creation (or whatever) code goes here
End Sub
'---------------------------------
Sub DisplayStuff(v1,v2)
'- display code goes here
End Sub
%>

Form will not send Information

So I have been sitting here racking my brain for a few hours and just cannot seem to find what I have wrong here. I am trying to get my form to send the information that the user inputs to my email. When I click send nothing happens... Anything would help! Thanks!
Here is the code I have atm:
Email me!
<div class="formCenter">
<form action="MAILTO:myemail#yahoo.com" method="post" enctype="text/plain">
First Name:<br>
<input type="text" name="firstName"><br>
Last Name:<br>
<input type="text" name="lastName"><br>
Email:<br>
<input type="text" name="email"><br>
Comments:<br>
<textarea name="commentBox" rows="6" cols="40"></textarea><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</div>
Okay so you have to send the Action to a page like Email.PHP (or ASP.net ect) which will process your POST variables.
Example:
<?php
$firstame = $_POST['firstName'];
?>
You then have to use Mail(), which will work on most servers but sometimes it won't so you can use a tool like PHPMailer which is an object orientated tool.
As you are providing the link as MAILTO, it opens up your local mail client to send an email with the POST variables listed, which is very unprofessional at best. You are better off having a link that goes to MAILTO for the time being, perhaps with a hidden value like or something like that, so when they open the client it automatically generates an email that they can just click. With that being said, you would keep your form layout as it is, but just swap out variables so they don't appear.
The reason you didn't see anything when you clicked Send is because even though your TYPE is a submit, you sometimes need the Value and/or Name to be Submit. Some browsers and servers will treat it differently, even frameworks like Bootsrap. If you change your name and value to Submit then change one back to Send to see what works for you, you can keep it in the Send format, given that it works.
I hope this helps.
you can try this one:
<?php
if($_POST["message"]) {
mail("your#email.address", "Form to email message", $_POST["message"], "From: an#email.address");
}
?>
see this page http://htmldog.com/techniques/formtoemail/
The form itself is not able to send the email. What the code does is prompts you to select email client software such as Outlook.
Did you check whether your email client software work properly? A reboot of machine is also a mean of troubleshooting.
JavaScript
function submitEmail() {
var fname = $.trim($("#txtfname").val());
var lname = $.trim($("#txtlname").val());
var email = $.trim($("#txtemail").val());
var comments = $.trim($("#txtComments").val());
if (isValidEmail(email) && (fname.length > 1) && (lname.length > 1)) {
$.ajax({
type: "POST",
url: "index.aspx/SubmitEmail",
data: "{'Email':'" + $.trim($("#txtemail").val()) + "'," + "'FName':'" + $.trim($("#txtfname").val()) + "'," + "'LName':'" + $.trim($("#txtlname").val()) + "'," + "'Comments':'" + $.trim($("#txtComments").val()) + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
if (response.d != "null") {
var JsonObj = $.parseJSON(response.d);
if (JsonObj._Status == "OK") {
alert('Success Email :)')
}
else {
alert(JsonObj._Message);
}
}
},
failure: function (msg) {
alert(msg);
}
});
}
else {
return false;
}
}
function isValidEmail(emailAddress) {
var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))#((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
return pattern.test(emailAddress);
};
<WebMethod()> _
Public Shared Function SubmitEmail(ByVal Email As String, ByVal FName As String, ByVal LName As String, ByVal Comments As String) As String
Dim _serializer = New JavaScriptSerializer()
Dim jSonRes As String = String.Empty
Dim MyString As New StringBuilder()
MyString.Append("First Name: " & FName).Append(Environment.NewLine)
MyString.Append("Last Name: " & LName).Append(Environment.NewLine)
MyString.Append("Email Address: " & Email).Append(Environment.NewLine)
MyString.Append("Comments: " & Comments).Append(Environment.NewLine)
Try
Dim Message As New Net.Mail.MailMessage("Do-Not-Reply#test.com", "myemail#yahoo.com")
Message.CC.Add("test#test.com,test#test.com")
Message.Subject = "New Request from " & FName & " " & LName
Message.IsBodyHtml = False
Message.Body = MyString.ToString()
Dim SmtpMail As New System.Net.Mail.SmtpClient
SmtpMail.Host = "localhost"
SmtpMail.Send(Message)
jSonRes = _serializer.Serialize(New With {._Status = "OK", ._Message = ""})
Catch ex As Exception
jSonRes = _serializer.Serialize(New With {._Status = "Error", ._Message = ex.Message})
End Try
Return jSonRes
End Function
<form action="index.aspx/submitEmail" method="post" enctype="text/plain">
First Name:<br>
<input type="text" name="firstName" id="fname"><br>
Last Name:<br>
<input type="text" name="lastName" id="lname"><br>
Email:<br>
<input type="text" name="email" id="txtemail"><br>
Comments:<br>
<textarea name="commentBox" rows="6" cols="40" id="txtComments"></textarea><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
This is the correct way to send a email. You can also use a php or C# code for sending a email. I have used vb.net code(webmethod) for sending email.

asp form question

I have this form
<form action="http://www.mysite.com/asp/formd.asp" method="post" target="_blank">
so the asp looks like below,
it opens a new window where ot says "send ok"
my question is how and where can I contro/define the style of this new window i.e background fonts color etc
thanks
the ASP code:
<%# Language=VBScript %>
<%
Dim txtbody
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.To = "mail#mail.com"
objCDO.From = "digital#adinet.com"
objCDO.Subject = "* *Formu enviado desde web * *"
txtbody = ""
for a = 1 to Request.Form.Count
txtbody = txtbody & Request.Form.Key(a) & " = " & Request.Form(a) & chr(10) & chr(13)
next
for a = 1 to Request.QueryString.Count
txtbody = txtbody & Request.QueryString.Key(a) & " = " & Request.QueryString(a) & chr(10) & chr(13)
next
txtbody = txtbody & "*******-----------------******"
objCDO.Body = txtbody
objCDO.Send
Response.Write "send = Ok"
%>
If you'd like to have a page or message that's more meaningful, consider replacing this
Response.Write "send = Ok"
with this:
Response.Redirect "email-thank-you.htm" 'or .asp, whatever you like.
Then go make your new page email-thank-you.htm as decorated and styled as nicely as you can. This helps by having your email logic contained in one page or function, and separate from the nice page. If something happened, i.e. the email server was unavailable, or perhaps the email address was malformed/missing, you could write that back to the original page.
If I understand what you're doing correctly, you should actually create a static form called emailForm.asp with your desired styling. Have it read the querystring that you are passing and and place the values in the fields. Put on link on your current page in order to pop this page up.
Your final line, Response.Write "send = Ok" is being output as a badly-formed html page.
I'd recommend you structure your page as follows:
<%# Language=VBScript %>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!-- Add header info, including links to style sheets -->
</head>
<body>
<%
'Your CDO code goes here
objCDO.Send
if err.number > 0 then
response.write "<p class='error'>Error: " & err.number & " - " & err.message & "</p>"
else
Response.write "<p class='ok'>Sent OK</p>"
end if
%>
</body>
</html>
This will render a full html page that you can style properly (and will also no presume that the email sent OK!).