Right i have just about had enough of
ASP now.
Here are my form and the
asp script they are running at
http://www.zrconsultants.co.uk/candi...istration.html
<------Form----->
<!DOCTYPE
HTML PUBLIC "-//
W3C//
DTD HTML 4.01 Transitional//EN">
<
html>
<head>
<title>Register Your CV</title>
<meta
http-equiv="Content-Type" content="text/
html; charset=iso-8859-1">
<script language=JavaScript src="Scripts/scroll.
js" type=text/javascript></script>
</head>
<body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<div align="left">
<script language=JavaScript src="Scripts/ZR_Menu.
js" type=text/javascript></script>
<script language=JavaScript src="Scripts/mmenu.
js" type=text/javascript></script>
</div>
<table width="780" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="110" colspan="3" align="center" valign="middle">[img]images/Banner.jpg[/img]</td>
</tr>
<tr>
<td width="9" rowspan="5" valign="top" bgcolor="#000033"></td>
<td width="762" height="37" valign="top">
<font color="#000066" size="2" face="Verdana">Candidate
Registration Form:</font> <hr></td>
<td width="9" rowspan="5" valign="top" bgcolor="#000033"></td>
</tr>
<tr>
<td height="14"></td>
</tr>
<tr>
<td height="43" align="center" valign="top">
<font color="#000066" size="2">
<font size="1" face="Verdana">To
register with ZR Consultants Ltd and receive regular job updates please
complete the below registration form.</font></font></p>
<font size="1" face="Verdana">
<font color="#000066">We will then
store your details and inform you of new vacancies as soon as they become
available.</font></font></p></td>
</tr>
<tr>
<td height="32"></td>
</tr>
<tr>
<td height="464" align="center" valign="middle"> <form METHOD="POST" ENCTYPE="multipart/form-data" action="cvupload.
asp" name="mailform" id="mailform">
<input TYPE="HIDDEN" NAME="where" value="Fileupload">
<table>
<tr>
<td width="158" ALIGN="right"><font color="#000066" size="1" face="Arial">
Title</font></td>
<td width="242"><font face="Arial">
<select name="Title" id="Title">
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
<option value="Doctor">Doctor</option>
<option value="Sir">Sir</option>
</select>
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
First
Name</font></td>
<td><font face="Arial">
<input NAME="First_Name" TYPE="TEXT" id="First_Name" SIZE="25">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
Last
Name</font></td>
<td><font face="Arial">
<input NAME="Last_Name" TYPE="TEXT" id="Last_Name" SIZE="25">
</font></td>
</tr>
<tr>
<td ALIGN="right">
<font color="#000066" size="1" face="Arial">Building
Name/No.</font></td>
<td><font face="Arial" color="#C0C0C0">
<input NAME="Building_No_Name" TYPE="TEXT" id="Building_No_Name" SIZE="35">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
Street</font></td>
<td><font face="Arial">
<input NAME="Street" TYPE="TEXT" id="Street" SIZE="35">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
Town</font></td>
<td><font face="Arial">
<input NAME="Town" TYPE="TEXT" id="Town" SIZE="35">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
County</font></td>
<td><font face="Arial">
<input NAME="County" TYPE="TEXT" id="County" SIZE="35">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
Postcode</font></td>
<td><font face="Arial">
<input NAME="Postcode" TYPE="TEXT" id="Postcode" SIZE="12" MAXLENGTH="12">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
Telephone
Number</font></td>
<td><font face="Arial">
<input NAME="Telephone_Number" TYPE="TEXT" id="Telephone_Number" SIZE="25">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
Mobile
number</font></td>
<td><font face="Arial">
<input NAME="Mobile_Number" TYPE="TEXT" id="Mobile_Number" SIZE="25" MAXLENGTH="25">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
Work
number ( Discretion Assured)</font></td>
<td><font face="Arial">
<input NAME="Work_Number" TYPE="TEXT" id="Work_Number" SIZE="25" MAXLENGTH="25">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
E-mail
Address</font></td>
<td><font face="Arial">
<input NAME="Email_Address" TYPE="TEXT" id="Email_Address" SIZE="40">
</font></td>
</tr>
<tr>
<td ALIGN="right"><font color="#000066" size="1" face="Arial">
Please
Attach Your CV here</font></td>
<td valign="middle" nowrap><font face="Arial">
<input name="CV" type="file" id="CV">
</font></td>
</tr>
<tr>
<td height="26" ALIGN="right" valign="top"><font color="#000066" size="1" face="Arial">
Sector</font></td>
<td valign="top"><font face="Arial">
<select name="Sector" id="Sector">
<option value="Accountancy">Accountancy</option>
<option value="Admin/Secretarila">Admin/Secretarila</option>
<option value="Banking">Banking</option>
<option value="Catering/Hospitality">Catering/Hospitality</option>
<option value="Creative/Media">Creative/Media</option>
<option value="Customer Services">Customer Services</option>
<option value="Education">Education</option>
<option value="Enigineering">Enigineering</option>
<option value="Financial Services">Financial Services</option>
<option value="General Insurance">General Insurance</option>
<option value="Health/Medical">Health/Medical</option>
<option value="HR/Training">HR/Training</option>
<option value="IT">IT</option>
<option value="Legal">Legal</option>
<option value="Leisure/Tourism">Leisure/Tourism</option>
<option value="Manufacturing/Production">Manufacturing/Production</option>
<option value="Marketing/Advertising">Marketing/Advertising</option>
<option value="Purchasing">Purchasing</option>
<option value="Recruitment Consultant">Recruitment Consultant</option>
<option value="Retail">Retail</option>
<option value="Sales">Sales</option>
<option value="Scientific Research">Scientific Research</option>
<option value="Social Care/Services">Social Care/Services</option>
<option value="Telecoms/Datacoms">Telecoms/Datacoms</option>
<option value="Transport/Logistics">Transport/Logistics</option>
<option value="Warehouse/Industrial">Warehouse/Industrial</option>
<option>Other</option>
</select>
</font></td>
</tr>
<tr>
<td height="21"></td>
<td></td>
</tr>
</table>
<p align="center"><font color="#C0C0C0">
<input TYPE="submit" VALUE="Send" name="Send">
<input TYPE="reset" VALUE="Reset" name="Reset">
</font></p>
</form></td>
</tr>
<tr>
<td height="20" colspan="3" align="center" valign="middle" bgcolor="#000033">
<font color="#FFFFFF" size="1.5" face="Verdana">Home</font><font color="#FFFFFF" size="1.5" face="Verdana">:
Terms
:
E-mail</font></td>
</tr>
</table>
<div align="left"></div>
</body>
</
html>
<-----
ASP Email Script------>
<%
Response.Buffer = true
Function BuildUpload(RequestBin)
PosBeg = 1
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
boundaryPos = InstrB(1,RequestBin,boundary)
Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--")))
Dim UploadControl
Set UploadControl = CreateObject("Scripting.Dictionary")
Pos = InstrB(BoundaryPos,RequestBin,getByteString("Conte nt-Disposition"))
Pos = InstrB(Pos,RequestBin,getByteString("name="))
PosBeg = Pos+6
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filen ame="))
PosBound = InstrB(PosEnd,RequestBin,boundary)
If PosFile<>0 AND (PosFile<PosBound) Then
PosBeg = PosFile + 10
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
UploadControl.Add "FileName", FileName
Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:"))
PosBeg = Pos+14
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
UploadControl.Add "ContentType",ContentType
PosBeg = PosEnd+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
Else
Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))
PosBeg = Pos+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
End If
UploadControl.Add "Value" , Value
UploadRequest.Add name, UploadControl
BoundaryPos=InstrB(BoundaryPos+LenB(boundary),Requ estBin,boundary)
Loop
End Function
Function getByteString(StringStr)
For i = 1 to Len(StringStr)
char = Mid(StringStr,i,1)
getByteString = getByteString & chrB(AscB(char))
Next
End Function
Function getString(StringBin)
getString =""
For intCount = 1 to LenB(StringBin)
getString = getString & chr(AscB(MidB(StringBin,intCount,1)))
Next
End Function
If request("Action")="1" then
Response.Clear
byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCount)
Set UploadRequest = CreateObject("Scripting.Dictionary")
BuildUpload(RequestBin)
'Create the file, change the path to the path U use for temp storage of the file
'make sure you have the IUSR_YOURCOMPUTER granted WRITE access to the uploads dir
If UploadRequest.Item("blob").Item("Value") <> "" Then
contentType = UploadRequest.Item("blob").Item("ContentType")
filepathname = UploadRequest.Item("blob").Item("FileName")
filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
FolderName = UploadRequest.Item("where").Item("Value")
Path = Mid(Request.ServerVariables("PATH_TRANSLATED"), 1, Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(Request.ServerVariables("PATH_INFO")))
ToFolder = Path & "\" & FolderName
value = UploadRequest.Item("blob").Item("Value")
filename = ToFolder & "\" & filename
Set MyFileObject = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = MyFileObject.CreateTextFile(filename)
For i = 1 to LenB(value)
objFile.Write chr(AscB(MidB(value,i,1)))
Next
objFile.Close
Set objFile = Nothing
Set MyFileObject = Nothing
End If
Title = UploadRequest.Item("Title").Item("Value")
FirstName = UploadRequest.Item("First_Name").Item("Value")
LastName = UploadRequest.Item("Last_Name").Item("Value")
Building_No_Name = UploadRequest.Item("Building_No_Name").Item("Value ")
Street = UploadRequest.Item("Street").Item("Value")
Town = UploadRequest.Item("Town").Item("Value")
County = UploadRequest.Item("County").Item("Value")
Postcode = UploadRequest.Item("Postcode").Item("Value")
Telephone_Number = UploadRequest.Item("Telephone_Number").Item("Value ")
Mobile_Number = UploadRequest.Item("Mobile_Number").Item("Value")
Work_Number = UploadRequest.Item("Work_Number").Item("Value")
Email_Address = UploadRequest.Item("Email_Address").Item("Value")
Sector = UploadRequest.Item("Sector").Item("Value")
Set UploadRequest = Nothing
body="<
html><body><p align='center'>
<font size='5' face='Times New Roman' color='#0000FF'>Candidate Registration Form </font></p>"
body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>
Title: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Title & "</td></tr>"
body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>
First Name: </td><td><font size='3' face='Times New Roman' color='#660033'>" & first_Name & "</td></tr>"
body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>
Last Name: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Last_Name & "</td></tr>"
body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>
Building Name/Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Building_No_Name & "</td></tr>"
body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>
Street: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Street & "</td></tr>"
body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>
Town: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Town & "</td></tr>"
body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>
County: </td><td><font size='3' face='Times New Roman' color='#660033'>" & County & "</td></tr>"
body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>
Postcode: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Postcode & "</td></tr>"
body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>
Telephone Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Telephone_Number & "</td></tr>"
body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>
Mobile Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Mobile_Number & "</td></tr>"
body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>
Work Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Work_Number & "</td></tr>"
body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>
Email Address: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Email_Address & "</td></tr>"
body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>
Sector: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Sector & "</td></tr>"
body = body & "</table></body></
html>"
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
ObjCDOMail.From = Email_Address
ObjCDOMail.To = "steve.owens@rslsteeper.com"
ObjCDOMail.BodyFormat = 0
ObjCDOmail.Mailformat = 0
ObjCDOMail.Subject = "Candidate Registration Form" & MyPosition
ObjCDOMail.Body = body
If Len(filename) > 5 then
ObjCDOMail.AttachFile filename,nikfile
end if
ObjCDOMail.Send
Set ObjCDOMail = Nothing
' Now the file in the uploads dir can be deleted
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile filename
set fso = nothing
End If
%>
<
html>
<script language='javascript'>
alert("Thank You for Registering Yor Resume");
location.replace("index.htm");
</script>
</
html>
please can some one tell me why it wont work or can they help me fix it?