Forums
This topic is locked
uploading file
Posted 30 May 2002 08:14:16
1
has voted
30 May 2002 08:14:16 mark chang posted:
Could you tell me what is this?I got it everytime when I was trying to upload a file in the forum I set up.
Form was submitted with no ENCTYPE="multipart/form-data"
Please correct the form attributes and try again.
Mark
Replies
Replied 30 May 2002 09:54:42
30 May 2002 09:54:42 Julio Taylor replied:
You need to change the for type in the code to multipart/form data, just make sure the form's code looks like this:
enctype="multipart/form-data"
i hope this helps.
--J
P.S. i killed kenny
enctype="multipart/form-data"
i hope this helps.
--J
P.S. i killed kenny
Replied 30 May 2002 11:04:36
30 May 2002 11:04:36 mark chang replied:
Dear poolio,
Thanks a lot for your reply. I am pretty new to ultradev, could you let me know more specifically how I could correct the erro? Do I make the change on reply.asp page/ if so, where is it?
Mark
Thanks a lot for your reply. I am pretty new to ultradev, could you let me know more specifically how I could correct the erro? Do I make the change on reply.asp page/ if so, where is it?
Mark
Replied 30 May 2002 11:08:29
30 May 2002 11:08:29 Julio Taylor replied:
ok,
you need to open your .asp page where your form is (e.g. reply.asp), and look at the code where the <FORM> tags are, should look like this or something similar.
<form name="form1" method="POST" action="<?php echo $MM_editAction?>" enctype="multipart/form-data">
make sure that it says "multipart/form-data" where shown, if not, just replace whatever is there with the multipart/form-data attributes.
If you can't do it, just post the code for your form in here and i'll have a look,
i hope this helps.
--J
P.S. i killed kenny
you need to open your .asp page where your form is (e.g. reply.asp), and look at the code where the <FORM> tags are, should look like this or something similar.
<form name="form1" method="POST" action="<?php echo $MM_editAction?>" enctype="multipart/form-data">
make sure that it says "multipart/form-data" where shown, if not, just replace whatever is there with the multipart/form-data attributes.
If you can't do it, just post the code for your form in here and i'll have a look,
i hope this helps.
--J
P.S. i killed kenny
Replied 30 May 2002 11:14:55
30 May 2002 11:14:55 mark chang replied:
Hi, poolio:
I did what you told, that enctype problem is gone. But I got a new one as below shown:
"Microsoft VBScript 运行时错误 错误 '800a0005'
无效的过程调用或参数: 'Left'
/info/macro_home.asp, 行215"
Anyway, I post the source code for the whole reply.asp page for your reference, could you help?
-------------- source code begin here---
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connInfo.asp" -->
<%
'*** File Upload to: uploadfiles/reply, Extensions: "", Form: [object FormElt], Redirect: ""
'*** Pure ASP File Upload -----------------------------------------------------
' Copyright 2000 (c) George Petrov
'
' Script partially based on code from Philippe Collignon
' (www.asptoday.com/articles/20000316.htm)
'
' New features from GP:
' * Fast file save with ADO 2.5 stream object
' * new wrapper functions, extra error checking
' * UltraDev Server Behavior extension
'
' Version: 1.5.0
'------------------------------------------------------------------------------
Sub BuildUploadRequest(RequestBin)
'Get the boundary
PosBeg = 1
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
if PosEnd = 0 then
Response.Write "<b>Form was submitted with no ENCTYPE=""multipart/form-data""</b><br>"
Response.Write "Please correct the form attributes and try again."
Response.End
end if
boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
boundaryPos = InstrB(1,RequestBin,boundary)
'Get all data inside the boundaries
Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))
'Members variable of objects are put in a dictionary object
Dim UploadControl
Set UploadControl = CreateObject("Scripting.Dictionary"
'Get an object name
Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-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("filename=")
PosBound = InstrB(PosEnd,RequestBin,boundary)
'Test if object is of file type
If PosFile<>0 AND (PosFile<PosBound) Then
'Get Filename, content-type and content of file
PosBeg = PosFile + 10
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
FileName = Mid(FileName,InStrRev(FileName,"\"+1)
'Add filename to dictionary object
UploadControl.Add "FileName", FileName
Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:")
PosBeg = Pos+14
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
'Add content-type to dictionary object
ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
UploadControl.Add "ContentType",ContentType
'Get content of object
PosBeg = PosEnd+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = FileName
ValueBeg = PosBeg-1
ValueLen = PosEnd-Posbeg
Else
'Get content of object
Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))
PosBeg = Pos+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
ValueBeg = 0
ValueEnd = 0
End If
'Add content to dictionary object
UploadControl.Add "Value" , Value
UploadControl.Add "ValueBeg" , ValueBeg
UploadControl.Add "ValueLen" , ValueLen
'Add dictionary object to main dictionary
UploadRequest.Add name, UploadControl
'Loop to next object
BoundaryPos=InstrB(BoundaryPos+LenB(boundary),RequestBin,boundary)
Loop
End Sub
'String to byte string conversion
Function getByteString(StringStr)
For i = 1 to Len(StringStr)
char = Mid(StringStr,i,1)
getByteString = getByteString & chrB(AscB(char))
Next
End Function
'Byte string to string conversion
Function getString(StringBin)
getString =""
For intCount = 1 to LenB(StringBin)
getString = getString & chr(AscB(MidB(StringBin,intCount,1)))
Next
End Function
Function UploadFormRequest(name)
on error resume next
if UploadRequest.Item(name) then
UploadFormRequest = UploadRequest.Item(name).Item("Value"
end if
End Function
'Process the upload
UploadQueryString = Replace(Request.QueryString,"GP_upload=true",""
if mid(UploadQueryString,1,1) = "&" then
UploadQueryString = Mid(UploadQueryString,2)
end if
GP_uploadAction = CStr(Request.ServerVariables("URL") & "?GP_upload=true"
If (Request.QueryString <> "" Then
if UploadQueryString <> "" then
GP_uploadAction = GP_uploadAction & "&" & UploadQueryString
end if
End If
If (CStr(Request.QueryString("GP_upload") <> "" Then
GP_redirectPage = ""
If (GP_redirectPage = "" Then
GP_redirectPage = CStr(Request.ServerVariables("URL")
end if
RequestBin = Request.BinaryRead(Request.TotalBytes)
Dim UploadRequest
Set UploadRequest = CreateObject("Scripting.Dictionary"
BuildUploadRequest RequestBin
GP_keys = UploadRequest.Keys
for GP_i = 0 to UploadRequest.Count - 1
GP_curKey = GP_keys(GP_i)
'Save all uploaded files
if UploadRequest.Item(GP_curKey).Item("FileName" <> "" then
GP_value = UploadRequest.Item(GP_curKey).Item("Value"
GP_valueBeg = UploadRequest.Item(GP_curKey).Item("ValueBeg"
GP_valueLen = UploadRequest.Item(GP_curKey).Item("ValueLen"
if GP_valueLen = 0 then
Response.Write "<B>An error has occured saving uploaded file!</B><br><br>"
Response.Write "Filename: " & Trim(GP_curPath) & UploadRequest.Item(GP_curKey).Item("FileName" & "<br>"
Response.Write "File does not exists or is empty.<br>"
Response.Write "Please correct and <A HREF=""javascript:history.back(1)"">try again</a>"
response.End
end if
'Create a Stream instance
Dim GP_strm1, GP_strm2
Set GP_strm1 = Server.CreateObject("ADODB.Stream"
Set GP_strm2 = Server.CreateObject("ADODB.Stream"
'Open the stream
GP_strm1.Open
GP_strm1.Type = 1 'Binary
GP_strm2.Open
GP_strm2.Type = 1 'Binary
GP_strm1.Write RequestBin
GP_strm1.Position = GP_ValueBeg
GP_strm1.CopyTo GP_strm2,GP_ValueLen
'Create and Write to a File
GP_curPath = Request.ServerVariables("PATH_INFO"
GP_curPath = Trim(Mid(GP_curPath,1,InStrRev(GP_curPath,"/") & "uploadfiles/reply"
if Mid(GP_curPath,Len(GP_curPath),1) <> "/" then
GP_curPath = GP_curPath & "/"
end if
on error resume next
GP_strm2.SaveToFile Trim(Server.mappath(GP_curPath))& "\" & UploadRequest.Item(GP_curKey).Item("FileName",2
if err then
Response.Write "<B>An error has occured saving uploaded file!</B><br><br>"
Response.Write "Filename: " & Trim(GP_curPath) & UploadRequest.Item(GP_curKey).Item("FileName" & "<br>"
Response.Write "Maybe the destination directory does not exist, or you don't have write permission.<br>"
Response.Write "Please correct and <A HREF=""javascript:history.back(1)"">try again</a>"
err.clear
response.End
end if
end if
next
'*** GP NO REDIRECT
end if
if UploadQueryString <> "" then
UploadQueryString = UploadQueryString & "&GP_upload=true"
else
UploadQueryString = "GP_upload=true"
end if
%>
<%
' *** Edit Operations: (Modified for File Upload) declare variables
MM_editAction = CStr(Request.ServerVariables("URL") 'MM_editAction = CStr(Request("URL")
If (UploadQueryString <> "" Then
MM_editAction = MM_editAction & "?" & UploadQueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: (Modified for File Upload) set variables
If (CStr(UploadFormRequest("MM_insert") <> "" Then
MM_editConnection = MM_connInfo_STRING
MM_editTable = "reply_file"
MM_editRedirectUrl = "macro_home.asp"
MM_fieldsStr = "name|value|radiobutton|value|file|value|topicID|value|uploadID|value|content|value"
MM_columnsStr = "name|',none,''|mood|',none,''|filename|',none,''|ID|none,none,NULL|uploadID|',none,''|content|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"
' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(UploadFormRequest(MM_fields(i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And UploadQueryString <> "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And UploadQueryString <> "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString
End If
End If
End If
%>
<%
' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it
If (CStr(UploadFormRequest("MM_insert") <> "" Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),","
Delim = MM_typeArray(0)
If (Delim = "none" Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none" Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none" Then EmptyVal = ""
If (FormVal = "" Then
FormVal = EmptyVal
Else
If (AltVal <> "" Then
FormVal = AltVal
ElseIf (Delim = "'" Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''" & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End if
MM_tableValues = MM_tableValues & MM_columns(i)
MM_dbValues = MM_dbValues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & " values (" & MM_dbValues & ""
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
if(Request.QueryString ("ID" <> "" then updatereply__MMColParam = Request.QueryString ("ID"
%>
<%
Dim rsreply__MMColParam
rsreply__MMColParam = "1"
if (Request.QueryString("ID" <> "" then rsreply__MMColParam = Request.QueryString("ID"
%>
<%
set rsreply = Server.CreateObject("ADODB.Recordset"
rsreply.ActiveConnection = MM_connInfo_STRING
rsreply.Source = "SELECT * FROM post_file WHERE ID = " + Replace(rsreply__MMColParam, "'", "''" + ""
rsreply.CursorType = 0
rsreply.CursorLocation = 2
rsreply.LockType = 3
rsreply.Open()
rsreply_numRows = 0
%>
<%
set updatereply = Server.CreateObject("ADODB.Command"
updatereply.ActiveConnection = MM_connInfo_STRING
updatereply.CommandText = "UPDATE post_file SET reply=reply+1, replytime=Now () WHERE ID=" + Replace(updatereply__MMColParam, "'", "''" + ""
updatereply.CommandType = 1
updatereply.CommandTimeout = 0
updatereply.Prepared = true
updatereply.Execute()
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="greyland.css" type="text/css">
<script language="JavaScript">
<!--
function getFileExtension(filePath) { //v1.0
fileName = ((filePath.indexOf('/') > -1) ? filePath.substring(filePath.lastIndexOf('/')+1,filePath.length) : filePath.substring(filePath.lastIndexOf('\\')+1,filePath.length));
return fileName.substring(fileName.lastIndexOf('.')+1,fileName.length);
}
function checkFileUpload(form,extensions) { //v1.0
document.MM_returnValue = true;
if (extensions && extensions != '') {
for (var i = 0; i<form.elements.length; i++) {
field = form.elements[i];
if (field.type.toUpperCase() != 'FILE') continue;
if (field.value == '') {
alert('File is required!');
document.MM_returnValue = false;field.focus();break;
}
if (extensions.toUpperCase().indexOf(getFileExtension(field.value).toUpperCase()) == -1) {
alert('This file is not allowed for uploading!');
document.MM_returnValue = false;field.focus();break;
} } }
}
//-->
</script>
</head>
<body bgcolor="#EBEBEB" text="#000000">
<form name="form1" method="POST" action="<%=MM_editAction%>" enctype="multipart/form-data">
<table width="650" border="0" cellspacing="0" cellpadding="0" align="center" height="74">
<tr>
<td class="verdana_16_bold_black" width="523">--- Post a reply in Macro-Trends
& Environment section ---</td>
<td class="verdana_11_black_normal" width="127">
<div align="center"><b>:::</b> <a href="macro_home.asp">Back Home</a></div>
</td>
</tr>
<tr>
<td colspan="2">
<hr size="1" width="100%" noshade>
<span class="verdana_11_black_normal">Dear Users:<br>
To make sure your uploaded file won't be overwritten by other
users' uploading files in the future. </span> <span class="verdana_11_black_normal">
Please give your uploading file an unique name, it could contain your
user name or your upload ID No. </span><span class="verdana_11_black_normal"><b><font color="#FF0000"><%=(rsreply.Fields.Item("uploadID".Value)%></font></b> (e.g. <b><font color="#FF0000"><%=(rsreply.Fields.Item("uploadID".Value)%></font></b> -myPhoto.jpg). </span>
<hr size="1" width="100%" noshade>
</td>
</tr>
</table>
<table width="550" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#333333">
<tr>
<td height="19">
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal">
<div align="right"> Name: </div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal">
<input type="text" name="name">
* (better put in your user name)</td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal">
<div align="right">Topic Name: </div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal"><b>Re:
" <%=(rsreply.Fields.Item("topicname".Value)%>" </b></td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal" valign="top">
<div align="right">Your Moods: </div>
</td>
<td bgcolor="#F3F3F3" width="76%" class="verdana_11_black_normal">
<div align="right"></div>
<table width="27" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3%">
<input type="radio" name="radiobutton" value="alien.gif">
</td>
<td width="7%"><img src="images/mood/alien.gif" width="15" height="15">
</td>
<td width="6%">
<input type="radio" name="radiobutton" value="angry2.gif">
</td>
<td width="4%"><img src="images/mood/angry2.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="bandit.gif">
</td>
<td width="4%"><img src="images/mood/bandit.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="biggrin.gif">
</td>
<td width="4%"><img src="images/mood/biggrin.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="binoculars2.gif">
</td>
<td width="4%"><img src="images/mood/binoculars2.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="boo.gif">
</td>
<td width="4%"><img src="images/mood/boo.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="cool.gif">
</td>
<td width="4%"><img src="images/mood/cool.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="devious.gif">
</td>
<td width="4%"><img src="images/mood/devious.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="dynamite.gif">
</td>
<td width="4%"><img src="images/mood/dynamite.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="eek.gif">
</td>
<td width="4%"><img src="images/mood/eek.gif" width="13" height="13"></td>
</tr>
<tr>
<td width="3%">
<input type="radio" name="radiobutton" value="frown.gif">
</td>
<td width="7%"><img src="images/mood/frown.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="gift.gif">
</td>
<td width="4%"><img src="images/mood/gift.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="headphones.gif">
</td>
<td width="4%"><img src="images/mood/headphones.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="help.gif">
</td>
<td width="4%"><img src="images/mood/help.gif" width="16" height="16"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="hi.gif">
</td>
<td width="4%"><img src="images/mood/hi.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="knocked-out.gif">
</td>
<td width="4%"><img src="images/mood/knocked-out.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="mad.gif">
</td>
<td width="4%"><img src="images/mood/mad.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="pirate(1).gif">
</td>
<td width="4%"><img src="images/mood/pirate(1).gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="no.gif">
</td>
<td width="4%"><img src="images/mood/no.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="razz.gif">
</td>
<td width="4%"><img src="images/mood/razz.gif" width="15" height="15"></td>
</tr>
<tr>
<td width="3%">
<input type="radio" name="radiobutton" value="redface.gif">
</td>
<td width="7%"><img src="images/mood/redface.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="rocket.gif">
</td>
<td width="4%"><img src="images/mood/rocket.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="rolleyes.gif">
</td>
<td width="4%"><img src="images/mood/rolleyes.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="smile.gif">
</td>
<td width="4%"><img src="images/mood/smile.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="surprised.gif">
</td>
<td width="4%"><img src="images/mood/surprised.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="tongue.gif">
</td>
<td width="4%"><img src="images/mood/tongue.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="unhappy.gif">
</td>
<td width="4%"><img src="images/mood/unhappy.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="wink.gif">
</td>
<td width="4%"><img src="images/mood/wink.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="yea.gif">
</td>
<td width="4%"><img src="images/mood/yea.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="nerd.gif" checked>
</td>
<td width="4%"><img src="images/mood/nerd.gif" width="15" height="15"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal">
<div align="right">Upload Files: </div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal">
<input type="file" name="file">
<input type="hidden" name="topicID" value="<%=(rsreply.Fields.Item("ID".Value)%>">
<i>
<input type="hidden" name="uploadID" value="<%=(rsreply.Fields.Item("uploadID".Value)%>">
</i> <i><font color="#993300">(your upload ID: <span class="verdana_11_black_normal"><b><%=(rsreply.Fields.Item("uploadID".Value)%><img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle></b></span></font></i></td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal">
<div align="right">Category: </div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal"><b><%=(rsreply.Fields.Item("category".Value)%></b> </td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal" valign="top">
<div align="right">Your comments:<br>
<br>
<i><font color="#FFC58A">(your comments of your topic or explanation
of your uploading files) </font></i></div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal">
<textarea name="content" rows="5" cols="45"></textarea>
* </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="24%"> </td>
<td width="76%">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</td>
</tr>
</table>
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="true">
</form>
<br>
<br>
</body>
</html>
<%
rsreply.Close()
%>
-----------------end of source code-----
thanks a lot poolio.
I did what you told, that enctype problem is gone. But I got a new one as below shown:
"Microsoft VBScript 运行时错误 错误 '800a0005'
无效的过程调用或参数: 'Left'
/info/macro_home.asp, 行215"
Anyway, I post the source code for the whole reply.asp page for your reference, could you help?
-------------- source code begin here---
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connInfo.asp" -->
<%
'*** File Upload to: uploadfiles/reply, Extensions: "", Form: [object FormElt], Redirect: ""
'*** Pure ASP File Upload -----------------------------------------------------
' Copyright 2000 (c) George Petrov
'
' Script partially based on code from Philippe Collignon
' (www.asptoday.com/articles/20000316.htm)
'
' New features from GP:
' * Fast file save with ADO 2.5 stream object
' * new wrapper functions, extra error checking
' * UltraDev Server Behavior extension
'
' Version: 1.5.0
'------------------------------------------------------------------------------
Sub BuildUploadRequest(RequestBin)
'Get the boundary
PosBeg = 1
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
if PosEnd = 0 then
Response.Write "<b>Form was submitted with no ENCTYPE=""multipart/form-data""</b><br>"
Response.Write "Please correct the form attributes and try again."
Response.End
end if
boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
boundaryPos = InstrB(1,RequestBin,boundary)
'Get all data inside the boundaries
Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))
'Members variable of objects are put in a dictionary object
Dim UploadControl
Set UploadControl = CreateObject("Scripting.Dictionary"
'Get an object name
Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-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("filename=")
PosBound = InstrB(PosEnd,RequestBin,boundary)
'Test if object is of file type
If PosFile<>0 AND (PosFile<PosBound) Then
'Get Filename, content-type and content of file
PosBeg = PosFile + 10
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
FileName = Mid(FileName,InStrRev(FileName,"\"+1)
'Add filename to dictionary object
UploadControl.Add "FileName", FileName
Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:")
PosBeg = Pos+14
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
'Add content-type to dictionary object
ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
UploadControl.Add "ContentType",ContentType
'Get content of object
PosBeg = PosEnd+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = FileName
ValueBeg = PosBeg-1
ValueLen = PosEnd-Posbeg
Else
'Get content of object
Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))
PosBeg = Pos+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
ValueBeg = 0
ValueEnd = 0
End If
'Add content to dictionary object
UploadControl.Add "Value" , Value
UploadControl.Add "ValueBeg" , ValueBeg
UploadControl.Add "ValueLen" , ValueLen
'Add dictionary object to main dictionary
UploadRequest.Add name, UploadControl
'Loop to next object
BoundaryPos=InstrB(BoundaryPos+LenB(boundary),RequestBin,boundary)
Loop
End Sub
'String to byte string conversion
Function getByteString(StringStr)
For i = 1 to Len(StringStr)
char = Mid(StringStr,i,1)
getByteString = getByteString & chrB(AscB(char))
Next
End Function
'Byte string to string conversion
Function getString(StringBin)
getString =""
For intCount = 1 to LenB(StringBin)
getString = getString & chr(AscB(MidB(StringBin,intCount,1)))
Next
End Function
Function UploadFormRequest(name)
on error resume next
if UploadRequest.Item(name) then
UploadFormRequest = UploadRequest.Item(name).Item("Value"
end if
End Function
'Process the upload
UploadQueryString = Replace(Request.QueryString,"GP_upload=true",""
if mid(UploadQueryString,1,1) = "&" then
UploadQueryString = Mid(UploadQueryString,2)
end if
GP_uploadAction = CStr(Request.ServerVariables("URL") & "?GP_upload=true"
If (Request.QueryString <> "" Then
if UploadQueryString <> "" then
GP_uploadAction = GP_uploadAction & "&" & UploadQueryString
end if
End If
If (CStr(Request.QueryString("GP_upload") <> "" Then
GP_redirectPage = ""
If (GP_redirectPage = "" Then
GP_redirectPage = CStr(Request.ServerVariables("URL")
end if
RequestBin = Request.BinaryRead(Request.TotalBytes)
Dim UploadRequest
Set UploadRequest = CreateObject("Scripting.Dictionary"
BuildUploadRequest RequestBin
GP_keys = UploadRequest.Keys
for GP_i = 0 to UploadRequest.Count - 1
GP_curKey = GP_keys(GP_i)
'Save all uploaded files
if UploadRequest.Item(GP_curKey).Item("FileName" <> "" then
GP_value = UploadRequest.Item(GP_curKey).Item("Value"
GP_valueBeg = UploadRequest.Item(GP_curKey).Item("ValueBeg"
GP_valueLen = UploadRequest.Item(GP_curKey).Item("ValueLen"
if GP_valueLen = 0 then
Response.Write "<B>An error has occured saving uploaded file!</B><br><br>"
Response.Write "Filename: " & Trim(GP_curPath) & UploadRequest.Item(GP_curKey).Item("FileName" & "<br>"
Response.Write "File does not exists or is empty.<br>"
Response.Write "Please correct and <A HREF=""javascript:history.back(1)"">try again</a>"
response.End
end if
'Create a Stream instance
Dim GP_strm1, GP_strm2
Set GP_strm1 = Server.CreateObject("ADODB.Stream"
Set GP_strm2 = Server.CreateObject("ADODB.Stream"
'Open the stream
GP_strm1.Open
GP_strm1.Type = 1 'Binary
GP_strm2.Open
GP_strm2.Type = 1 'Binary
GP_strm1.Write RequestBin
GP_strm1.Position = GP_ValueBeg
GP_strm1.CopyTo GP_strm2,GP_ValueLen
'Create and Write to a File
GP_curPath = Request.ServerVariables("PATH_INFO"
GP_curPath = Trim(Mid(GP_curPath,1,InStrRev(GP_curPath,"/") & "uploadfiles/reply"
if Mid(GP_curPath,Len(GP_curPath),1) <> "/" then
GP_curPath = GP_curPath & "/"
end if
on error resume next
GP_strm2.SaveToFile Trim(Server.mappath(GP_curPath))& "\" & UploadRequest.Item(GP_curKey).Item("FileName",2
if err then
Response.Write "<B>An error has occured saving uploaded file!</B><br><br>"
Response.Write "Filename: " & Trim(GP_curPath) & UploadRequest.Item(GP_curKey).Item("FileName" & "<br>"
Response.Write "Maybe the destination directory does not exist, or you don't have write permission.<br>"
Response.Write "Please correct and <A HREF=""javascript:history.back(1)"">try again</a>"
err.clear
response.End
end if
end if
next
'*** GP NO REDIRECT
end if
if UploadQueryString <> "" then
UploadQueryString = UploadQueryString & "&GP_upload=true"
else
UploadQueryString = "GP_upload=true"
end if
%>
<%
' *** Edit Operations: (Modified for File Upload) declare variables
MM_editAction = CStr(Request.ServerVariables("URL") 'MM_editAction = CStr(Request("URL")
If (UploadQueryString <> "" Then
MM_editAction = MM_editAction & "?" & UploadQueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: (Modified for File Upload) set variables
If (CStr(UploadFormRequest("MM_insert") <> "" Then
MM_editConnection = MM_connInfo_STRING
MM_editTable = "reply_file"
MM_editRedirectUrl = "macro_home.asp"
MM_fieldsStr = "name|value|radiobutton|value|file|value|topicID|value|uploadID|value|content|value"
MM_columnsStr = "name|',none,''|mood|',none,''|filename|',none,''|ID|none,none,NULL|uploadID|',none,''|content|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"
' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(UploadFormRequest(MM_fields(i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And UploadQueryString <> "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And UploadQueryString <> "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString
End If
End If
End If
%>
<%
' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it
If (CStr(UploadFormRequest("MM_insert") <> "" Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),","
Delim = MM_typeArray(0)
If (Delim = "none" Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none" Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none" Then EmptyVal = ""
If (FormVal = "" Then
FormVal = EmptyVal
Else
If (AltVal <> "" Then
FormVal = AltVal
ElseIf (Delim = "'" Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''" & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End if
MM_tableValues = MM_tableValues & MM_columns(i)
MM_dbValues = MM_dbValues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & " values (" & MM_dbValues & ""
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
if(Request.QueryString ("ID" <> "" then updatereply__MMColParam = Request.QueryString ("ID"
%>
<%
Dim rsreply__MMColParam
rsreply__MMColParam = "1"
if (Request.QueryString("ID" <> "" then rsreply__MMColParam = Request.QueryString("ID"
%>
<%
set rsreply = Server.CreateObject("ADODB.Recordset"
rsreply.ActiveConnection = MM_connInfo_STRING
rsreply.Source = "SELECT * FROM post_file WHERE ID = " + Replace(rsreply__MMColParam, "'", "''" + ""
rsreply.CursorType = 0
rsreply.CursorLocation = 2
rsreply.LockType = 3
rsreply.Open()
rsreply_numRows = 0
%>
<%
set updatereply = Server.CreateObject("ADODB.Command"
updatereply.ActiveConnection = MM_connInfo_STRING
updatereply.CommandText = "UPDATE post_file SET reply=reply+1, replytime=Now () WHERE ID=" + Replace(updatereply__MMColParam, "'", "''" + ""
updatereply.CommandType = 1
updatereply.CommandTimeout = 0
updatereply.Prepared = true
updatereply.Execute()
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="greyland.css" type="text/css">
<script language="JavaScript">
<!--
function getFileExtension(filePath) { //v1.0
fileName = ((filePath.indexOf('/') > -1) ? filePath.substring(filePath.lastIndexOf('/')+1,filePath.length) : filePath.substring(filePath.lastIndexOf('\\')+1,filePath.length));
return fileName.substring(fileName.lastIndexOf('.')+1,fileName.length);
}
function checkFileUpload(form,extensions) { //v1.0
document.MM_returnValue = true;
if (extensions && extensions != '') {
for (var i = 0; i<form.elements.length; i++) {
field = form.elements[i];
if (field.type.toUpperCase() != 'FILE') continue;
if (field.value == '') {
alert('File is required!');
document.MM_returnValue = false;field.focus();break;
}
if (extensions.toUpperCase().indexOf(getFileExtension(field.value).toUpperCase()) == -1) {
alert('This file is not allowed for uploading!');
document.MM_returnValue = false;field.focus();break;
} } }
}
//-->
</script>
</head>
<body bgcolor="#EBEBEB" text="#000000">
<form name="form1" method="POST" action="<%=MM_editAction%>" enctype="multipart/form-data">
<table width="650" border="0" cellspacing="0" cellpadding="0" align="center" height="74">
<tr>
<td class="verdana_16_bold_black" width="523">--- Post a reply in Macro-Trends
& Environment section ---</td>
<td class="verdana_11_black_normal" width="127">
<div align="center"><b>:::</b> <a href="macro_home.asp">Back Home</a></div>
</td>
</tr>
<tr>
<td colspan="2">
<hr size="1" width="100%" noshade>
<span class="verdana_11_black_normal">Dear Users:<br>
To make sure your uploaded file won't be overwritten by other
users' uploading files in the future. </span> <span class="verdana_11_black_normal">
Please give your uploading file an unique name, it could contain your
user name or your upload ID No. </span><span class="verdana_11_black_normal"><b><font color="#FF0000"><%=(rsreply.Fields.Item("uploadID".Value)%></font></b> (e.g. <b><font color="#FF0000"><%=(rsreply.Fields.Item("uploadID".Value)%></font></b> -myPhoto.jpg). </span>
<hr size="1" width="100%" noshade>
</td>
</tr>
</table>
<table width="550" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#333333">
<tr>
<td height="19">
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal">
<div align="right"> Name: </div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal">
<input type="text" name="name">
* (better put in your user name)</td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal">
<div align="right">Topic Name: </div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal"><b>Re:
" <%=(rsreply.Fields.Item("topicname".Value)%>" </b></td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal" valign="top">
<div align="right">Your Moods: </div>
</td>
<td bgcolor="#F3F3F3" width="76%" class="verdana_11_black_normal">
<div align="right"></div>
<table width="27" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3%">
<input type="radio" name="radiobutton" value="alien.gif">
</td>
<td width="7%"><img src="images/mood/alien.gif" width="15" height="15">
</td>
<td width="6%">
<input type="radio" name="radiobutton" value="angry2.gif">
</td>
<td width="4%"><img src="images/mood/angry2.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="bandit.gif">
</td>
<td width="4%"><img src="images/mood/bandit.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="biggrin.gif">
</td>
<td width="4%"><img src="images/mood/biggrin.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="binoculars2.gif">
</td>
<td width="4%"><img src="images/mood/binoculars2.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="boo.gif">
</td>
<td width="4%"><img src="images/mood/boo.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="cool.gif">
</td>
<td width="4%"><img src="images/mood/cool.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="devious.gif">
</td>
<td width="4%"><img src="images/mood/devious.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="dynamite.gif">
</td>
<td width="4%"><img src="images/mood/dynamite.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="eek.gif">
</td>
<td width="4%"><img src="images/mood/eek.gif" width="13" height="13"></td>
</tr>
<tr>
<td width="3%">
<input type="radio" name="radiobutton" value="frown.gif">
</td>
<td width="7%"><img src="images/mood/frown.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="gift.gif">
</td>
<td width="4%"><img src="images/mood/gift.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="headphones.gif">
</td>
<td width="4%"><img src="images/mood/headphones.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="help.gif">
</td>
<td width="4%"><img src="images/mood/help.gif" width="16" height="16"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="hi.gif">
</td>
<td width="4%"><img src="images/mood/hi.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="knocked-out.gif">
</td>
<td width="4%"><img src="images/mood/knocked-out.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="mad.gif">
</td>
<td width="4%"><img src="images/mood/mad.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="pirate(1).gif">
</td>
<td width="4%"><img src="images/mood/pirate(1).gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="no.gif">
</td>
<td width="4%"><img src="images/mood/no.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="razz.gif">
</td>
<td width="4%"><img src="images/mood/razz.gif" width="15" height="15"></td>
</tr>
<tr>
<td width="3%">
<input type="radio" name="radiobutton" value="redface.gif">
</td>
<td width="7%"><img src="images/mood/redface.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="rocket.gif">
</td>
<td width="4%"><img src="images/mood/rocket.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="rolleyes.gif">
</td>
<td width="4%"><img src="images/mood/rolleyes.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="smile.gif">
</td>
<td width="4%"><img src="images/mood/smile.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="surprised.gif">
</td>
<td width="4%"><img src="images/mood/surprised.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="tongue.gif">
</td>
<td width="4%"><img src="images/mood/tongue.gif" width="13" height="13"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="unhappy.gif">
</td>
<td width="4%"><img src="images/mood/unhappy.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="wink.gif">
</td>
<td width="4%"><img src="images/mood/wink.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="yea.gif">
</td>
<td width="4%"><img src="images/mood/yea.gif" width="15" height="15"></td>
<td width="6%">
<input type="radio" name="radiobutton" value="nerd.gif" checked>
</td>
<td width="4%"><img src="images/mood/nerd.gif" width="15" height="15"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal">
<div align="right">Upload Files: </div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal">
<input type="file" name="file">
<input type="hidden" name="topicID" value="<%=(rsreply.Fields.Item("ID".Value)%>">
<i>
<input type="hidden" name="uploadID" value="<%=(rsreply.Fields.Item("uploadID".Value)%>">
</i> <i><font color="#993300">(your upload ID: <span class="verdana_11_black_normal"><b><%=(rsreply.Fields.Item("uploadID".Value)%><img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle></b></span></font></i></td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal">
<div align="right">Category: </div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal"><b><%=(rsreply.Fields.Item("category".Value)%></b> </td>
</tr>
<tr>
<td bgcolor="#666666" width="24%" class="verdana_11_white_normal" valign="top">
<div align="right">Your comments:<br>
<br>
<i><font color="#FFC58A">(your comments of your topic or explanation
of your uploading files) </font></i></div>
</td>
<td bgcolor="#E1E1E1" width="76%" class="verdana_11_black_normal">
<textarea name="content" rows="5" cols="45"></textarea>
* </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="24%"> </td>
<td width="76%">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</td>
</tr>
</table>
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="true">
</form>
<br>
<br>
</body>
</html>
<%
rsreply.Close()
%>
-----------------end of source code-----
thanks a lot poolio.
Replied 30 May 2002 11:18:11
30 May 2002 11:18:11 mark chang replied:
Sorry Poolio,
I guess I got the wrong source code for you, it should be the another page called macro_home.asp, code as below shown:
---------------------sour code begin -----
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connInfo.asp" -->
<%
set rsmacrohome = Server.CreateObject("ADODB.Recordset"
rsmacrohome.ActiveConnection = MM_connInfo_STRING
rsmacrohome.Source = "SELECT * FROM post_file ORDER BY createtime DESC"
rsmacrohome.CursorType = 0
rsmacrohome.CursorLocation = 2
rsmacrohome.LockType = 3
rsmacrohome.Open()
rsmacrohome_numRows = 0
%>
<%
Dim rsuser__MMColParam
rsuser__MMColParam = "1"
if (Session("MM_Username" <> "" then rsuser__MMColParam = Session("MM_Username"
%>
<%
set rsuser = Server.CreateObject("ADODB.Recordset"
rsuser.ActiveConnection = MM_connInfo_STRING
rsuser.Source = "SELECT * FROM user WHERE name = '" + Replace(rsuser__MMColParam, "'", "''" + "'"
rsuser.CursorType = 0
rsuser.CursorLocation = 2
rsuser.LockType = 3
rsuser.Open()
rsuser_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 15
Dim Repeat1__index
Repeat1__index = 0
rsmacrohome_numRows = rsmacrohome_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
' set the record count
rsmacrohome_total = rsmacrohome.RecordCount
' set the number of rows displayed on this page
If (rsmacrohome_numRows < 0) Then
rsmacrohome_numRows = rsmacrohome_total
Elseif (rsmacrohome_numRows = 0) Then
rsmacrohome_numRows = 1
End If
' set the first and last displayed record
rsmacrohome_first = 1
rsmacrohome_last = rsmacrohome_first + rsmacrohome_numRows - 1
' if we have the correct record count, check the other stats
If (rsmacrohome_total <> -1) Then
If (rsmacrohome_first > rsmacrohome_total) Then rsmacrohome_first = rsmacrohome_total
If (rsmacrohome_last > rsmacrohome_total) Then rsmacrohome_last = rsmacrohome_total
If (rsmacrohome_numRows > rsmacrohome_total) Then rsmacrohome_numRows = rsmacrohome_total
End If
%>
<%
' *** Move To Record and Go To Record: declare variables
Set MM_rs = rsmacrohome
MM_rsCount = rsmacrohome_total
MM_size = rsmacrohome_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "" Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> ""
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter
if (Not MM_paramIsDefined And MM_rsCount <> 0) then
' use index parameter if defined, otherwise use offset parameter
r = Request.QueryString("index"
If r = "" Then r = Request.QueryString("offset"
If r <> "" Then MM_offset = Int(r)
' if we have a record count, check if we are past the end of the recordset
If (MM_rsCount <> -1) Then
If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last
If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' move the cursor to the selected record
i = 0
While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1))
MM_rs.MoveNext
i = i + 1
Wend
If (MM_rs.EOF) Then MM_offset = i ' set MM_offset to the last possible record
End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range
If (MM_rsCount = -1) Then
' walk to the end of the display range for this page
i = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
MM_rs.MoveNext
i = i + 1
Wend
' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = i
If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
End If
' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If
' move the cursor to the selected record
i = 0
While (Not MM_rs.EOF And i < MM_offset)
MM_rs.MoveNext
i = i + 1
Wend
End If
%>
<%
' *** Move To Record: update recordset stats
' set the first and last displayed record
rsmacrohome_first = MM_offset + 1
rsmacrohome_last = MM_offset + MM_size
If (MM_rsCount <> -1) Then
If (rsmacrohome_first > MM_rsCount) Then rsmacrohome_first = MM_rsCount
If (rsmacrohome_last > MM_rsCount) Then rsmacrohome_last = MM_rsCount
End If
' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "" Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "" Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "" Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "" Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "" Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links
MM_keepMove = MM_keepBoth
MM_moveParam = "index"
' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 0) Then
MM_moveParam = "offset"
If (MM_keepMove <> "" Then
params = Split(MM_keepMove, "&"
MM_keepMove = ""
For i = 0 To UBound(params)
nextItem = Left(params(i), InStr(params(i),"=" - 1)
If (StrComp(nextItem,MM_moveParam,1) <> 0) Then
MM_keepMove = MM_keepMove & "&" & params(i)
End If
Next
If (MM_keepMove <> "" Then
MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
End If
End If
End If
' set the strings for the move to links
If (MM_keepMove <> "" Then MM_keepMove = MM_keepMove & "&"
urlStr = Request.ServerVariables("URL" & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = urlStr & "0"
MM_moveLast = urlStr & "-1"
MM_moveNext = urlStr & Cstr(MM_offset + MM_size)
prev = MM_offset - MM_size
If (prev < 0) Then prev = 0
MM_movePrev = urlStr & Cstr(prev)
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="greyland.css" type="text/css">
</head>
<body bgcolor="#EBEBEB" text="#000000">
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="55%" class="verdana_11_black_normal">Dear <b><font color="#FF0000"><%=(rsuser.Fields.Item("name".Value)%></font></b>
:<br>
--- Welcome to the Info Base of The Grey Land !</td>
<td width="9%">
<div align="right"></div>
</td>
<td width="14%" class="verdana_11_black_normal">
<div align="center"><b>:::</b> <a href="home.asp">Back Home</a></div>
</td>
<td width="10%" class="verdana_11_black_normal">
<div align="center"><b>:::</b> Search</div>
</td>
<td width="12%" class="verdana_11_black_normal">
<div align="center"><b>:::</b> <a href="macro_new.asp">New Topic</a></div>
</td>
</tr>
</table>
<hr noshade width="750" size="1" align="center">
<br>
<table width="725" border="0" cellspacing="1" cellpadding="0" bgcolor="#333333" align="center" height="8">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="2" height="50" align="center">
<tr bgcolor="#333333">
<td width="223" class="verdana_11_white_normal"><b>Topic Name</b></td>
<td width="74" class="verdana_11_white_normal">
<div align="center"><b>Post By</b></div>
</td>
<td width="147" class="verdana_11_white_normal">
<div align="center"><b>Category</b></div>
</td>
<td width="55" class="verdana_11_white_normal">
<div align="center"><b>Reply</b></div>
</td>
<td width="44" class="verdana_11_white_normal">
<div align="center"><b>View</b></div>
</td>
<td width="149" class="verdana_11_white_normal">
<div align="center"><b>Last Reply</b></div>
</td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsmacrohome.EOF))
%>
<% If Not rsmacrohome.EOF Or Not rsmacrohome.BOF Then %>
<tr bgcolor="#FFFFFF">
<td width="223" class="verdana_11_black_normal"><img src="images/mood/<%=(rsmacrohome.Fields.Item("mood".Value)%>">
: <A HREF="macro_display.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "ID=" & rsmacrohome.Fields.Item("ID".Value %>"><%=(rsmacrohome.Fields.Item("topicname".Value)%></A></td>
<td width="74" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("name".Value)%></div>
</td>
<td width="147" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("category".Value)%></div>
</td>
<td width="55" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("reply".Value)%></div>
</td>
<td width="44" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("hit".Value)%></div>
</td>
<td width="149" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("replytime".Value)%></div>
</td>
</tr>
<% End If ' end Not rsmacrohome.EOF Or NOT rsmacrohome.BOF %>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsmacrohome.MoveNext()
Wend
%>
</table>
</td>
</tr>
</table>
<br>
<table border="0" width="120" align="right">
<tr>
<td width="29%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_moveFirst%>"><img src="First.gif" border=0></a>
<% End If ' end MM_offset <> 0 %>
</td>
<td width="23%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_movePrev%>"><img src="Previous.gif" border=0></a>
<% End If ' end MM_offset <> 0 %>
</td>
<td width="26%" align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveNext%>"><img src="Next.gif" border=0></a>
<% End If ' end Not MM_atTotal %>
</td>
<td width="22%" align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveLast%>"><img src="Last.gif" border=0></a>
<% End If ' end Not MM_atTotal %>
</td>
</tr>
</table>
<br>
</body>
</html>
<%
rsmacrohome.Close()
%>
<%
rsuser.Close()
%>
--------------------- source code ends---
thanks a lot poolio! Mark
I guess I got the wrong source code for you, it should be the another page called macro_home.asp, code as below shown:
---------------------sour code begin -----
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connInfo.asp" -->
<%
set rsmacrohome = Server.CreateObject("ADODB.Recordset"
rsmacrohome.ActiveConnection = MM_connInfo_STRING
rsmacrohome.Source = "SELECT * FROM post_file ORDER BY createtime DESC"
rsmacrohome.CursorType = 0
rsmacrohome.CursorLocation = 2
rsmacrohome.LockType = 3
rsmacrohome.Open()
rsmacrohome_numRows = 0
%>
<%
Dim rsuser__MMColParam
rsuser__MMColParam = "1"
if (Session("MM_Username" <> "" then rsuser__MMColParam = Session("MM_Username"
%>
<%
set rsuser = Server.CreateObject("ADODB.Recordset"
rsuser.ActiveConnection = MM_connInfo_STRING
rsuser.Source = "SELECT * FROM user WHERE name = '" + Replace(rsuser__MMColParam, "'", "''" + "'"
rsuser.CursorType = 0
rsuser.CursorLocation = 2
rsuser.LockType = 3
rsuser.Open()
rsuser_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 15
Dim Repeat1__index
Repeat1__index = 0
rsmacrohome_numRows = rsmacrohome_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
' set the record count
rsmacrohome_total = rsmacrohome.RecordCount
' set the number of rows displayed on this page
If (rsmacrohome_numRows < 0) Then
rsmacrohome_numRows = rsmacrohome_total
Elseif (rsmacrohome_numRows = 0) Then
rsmacrohome_numRows = 1
End If
' set the first and last displayed record
rsmacrohome_first = 1
rsmacrohome_last = rsmacrohome_first + rsmacrohome_numRows - 1
' if we have the correct record count, check the other stats
If (rsmacrohome_total <> -1) Then
If (rsmacrohome_first > rsmacrohome_total) Then rsmacrohome_first = rsmacrohome_total
If (rsmacrohome_last > rsmacrohome_total) Then rsmacrohome_last = rsmacrohome_total
If (rsmacrohome_numRows > rsmacrohome_total) Then rsmacrohome_numRows = rsmacrohome_total
End If
%>
<%
' *** Move To Record and Go To Record: declare variables
Set MM_rs = rsmacrohome
MM_rsCount = rsmacrohome_total
MM_size = rsmacrohome_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "" Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> ""
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter
if (Not MM_paramIsDefined And MM_rsCount <> 0) then
' use index parameter if defined, otherwise use offset parameter
r = Request.QueryString("index"
If r = "" Then r = Request.QueryString("offset"
If r <> "" Then MM_offset = Int(r)
' if we have a record count, check if we are past the end of the recordset
If (MM_rsCount <> -1) Then
If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last
If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' move the cursor to the selected record
i = 0
While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1))
MM_rs.MoveNext
i = i + 1
Wend
If (MM_rs.EOF) Then MM_offset = i ' set MM_offset to the last possible record
End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range
If (MM_rsCount = -1) Then
' walk to the end of the display range for this page
i = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
MM_rs.MoveNext
i = i + 1
Wend
' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = i
If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
End If
' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If
' move the cursor to the selected record
i = 0
While (Not MM_rs.EOF And i < MM_offset)
MM_rs.MoveNext
i = i + 1
Wend
End If
%>
<%
' *** Move To Record: update recordset stats
' set the first and last displayed record
rsmacrohome_first = MM_offset + 1
rsmacrohome_last = MM_offset + MM_size
If (MM_rsCount <> -1) Then
If (rsmacrohome_first > MM_rsCount) Then rsmacrohome_first = MM_rsCount
If (rsmacrohome_last > MM_rsCount) Then rsmacrohome_last = MM_rsCount
End If
' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "" Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "" Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "" Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "" Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "" Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links
MM_keepMove = MM_keepBoth
MM_moveParam = "index"
' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 0) Then
MM_moveParam = "offset"
If (MM_keepMove <> "" Then
params = Split(MM_keepMove, "&"
MM_keepMove = ""
For i = 0 To UBound(params)
nextItem = Left(params(i), InStr(params(i),"=" - 1)
If (StrComp(nextItem,MM_moveParam,1) <> 0) Then
MM_keepMove = MM_keepMove & "&" & params(i)
End If
Next
If (MM_keepMove <> "" Then
MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
End If
End If
End If
' set the strings for the move to links
If (MM_keepMove <> "" Then MM_keepMove = MM_keepMove & "&"
urlStr = Request.ServerVariables("URL" & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = urlStr & "0"
MM_moveLast = urlStr & "-1"
MM_moveNext = urlStr & Cstr(MM_offset + MM_size)
prev = MM_offset - MM_size
If (prev < 0) Then prev = 0
MM_movePrev = urlStr & Cstr(prev)
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="greyland.css" type="text/css">
</head>
<body bgcolor="#EBEBEB" text="#000000">
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="55%" class="verdana_11_black_normal">Dear <b><font color="#FF0000"><%=(rsuser.Fields.Item("name".Value)%></font></b>
:<br>
--- Welcome to the Info Base of The Grey Land !</td>
<td width="9%">
<div align="right"></div>
</td>
<td width="14%" class="verdana_11_black_normal">
<div align="center"><b>:::</b> <a href="home.asp">Back Home</a></div>
</td>
<td width="10%" class="verdana_11_black_normal">
<div align="center"><b>:::</b> Search</div>
</td>
<td width="12%" class="verdana_11_black_normal">
<div align="center"><b>:::</b> <a href="macro_new.asp">New Topic</a></div>
</td>
</tr>
</table>
<hr noshade width="750" size="1" align="center">
<br>
<table width="725" border="0" cellspacing="1" cellpadding="0" bgcolor="#333333" align="center" height="8">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="2" height="50" align="center">
<tr bgcolor="#333333">
<td width="223" class="verdana_11_white_normal"><b>Topic Name</b></td>
<td width="74" class="verdana_11_white_normal">
<div align="center"><b>Post By</b></div>
</td>
<td width="147" class="verdana_11_white_normal">
<div align="center"><b>Category</b></div>
</td>
<td width="55" class="verdana_11_white_normal">
<div align="center"><b>Reply</b></div>
</td>
<td width="44" class="verdana_11_white_normal">
<div align="center"><b>View</b></div>
</td>
<td width="149" class="verdana_11_white_normal">
<div align="center"><b>Last Reply</b></div>
</td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsmacrohome.EOF))
%>
<% If Not rsmacrohome.EOF Or Not rsmacrohome.BOF Then %>
<tr bgcolor="#FFFFFF">
<td width="223" class="verdana_11_black_normal"><img src="images/mood/<%=(rsmacrohome.Fields.Item("mood".Value)%>">
: <A HREF="macro_display.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "ID=" & rsmacrohome.Fields.Item("ID".Value %>"><%=(rsmacrohome.Fields.Item("topicname".Value)%></A></td>
<td width="74" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("name".Value)%></div>
</td>
<td width="147" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("category".Value)%></div>
</td>
<td width="55" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("reply".Value)%></div>
</td>
<td width="44" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("hit".Value)%></div>
</td>
<td width="149" class="verdana_11_black_normal">
<div align="center"><%=(rsmacrohome.Fields.Item("replytime".Value)%></div>
</td>
</tr>
<% End If ' end Not rsmacrohome.EOF Or NOT rsmacrohome.BOF %>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsmacrohome.MoveNext()
Wend
%>
</table>
</td>
</tr>
</table>
<br>
<table border="0" width="120" align="right">
<tr>
<td width="29%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_moveFirst%>"><img src="First.gif" border=0></a>
<% End If ' end MM_offset <> 0 %>
</td>
<td width="23%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_movePrev%>"><img src="Previous.gif" border=0></a>
<% End If ' end MM_offset <> 0 %>
</td>
<td width="26%" align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveNext%>"><img src="Next.gif" border=0></a>
<% End If ' end Not MM_atTotal %>
</td>
<td width="22%" align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveLast%>"><img src="Last.gif" border=0></a>
<% End If ' end Not MM_atTotal %>
</td>
</tr>
</table>
<br>
</body>
</html>
<%
rsmacrohome.Close()
%>
<%
rsuser.Close()
%>
--------------------- source code ends---
thanks a lot poolio! Mark