出来るのだASP Q&A掲示板(過去LOG)  訪問数 52046 昨日 889 今日 776
    【PR】 パソコン入門からIT専門書まで幅広く取り揃えています。セブン-イレブン受取り手数料無料のセブンアンドワイ。
Topに戻る 掲示板に戻る 検索 削除 管理者

[4086] 返信ありがとうございます。
投稿者:jimnyさん 2004/02/27 23:32:48
遅くなりました。メールありがとうございます。
実は、エラーメッセージの前に白い画面になって動きませんでした。コードを一行づつして見たのですが、ASPファイルの
スプリクトが反応していないようでした。
本当は駄目だと思うのですが、以下のファイルです。
すみません。どうしても動かずお教えください。
ファイル構成は、
home/html/form.html
home/asp/bbs.asp
です。
よろしくお願い致します。
--BBS.ASP-----------------------------------------------------
<%
set objFile=Server.CreateObject("Scripting.FileSystemObject")
LogFile=Server.MapPath("bbslog.txt")
FormFile=Server.MapPath("/home/html/form.html")
NAME=Request.Form("name")
MAIL=Request.Form("mail")
TITLE=Request.Form("title")
MSG=Request.Form("msg")
MSG=replace(MSG,"","")
MSG=replace(MSG,"|","|")
MSG=replace(MSG,"<","<")
if NAME & MAIL & TITLE & MSG ="" then
Call Disp
elseif NAME="" or TITLE="" or MSG="" then
Response.Write"<br><font size=6 color=#ff0000>E-mail以外の項目は全て入力して下さい</font><br><br>"
else
Call Write
Call Disp
end if
%>
</body>
</html>
<script language=VBScript runat=Server>
sub Write
On error resume next
MSG=Replace(MSG,Chr(13),"<br>")
MSG=Replace(MSG,CHr(10),"")
EDate=FormatDateTime(now(),vbShortDate) &"" & FormatDateTime(now(),vbShortTime)

set InStream=objFile.OpenTextFile(logFile,1,True)
sOldLog=InStream.ReadAll
iNo = InStream.line
InStream.Close

sWriteBuf="<table cellpadding=4 width=100% border><tr>"
sWriteBuf=sWriteBuf&"<td bgcollor=#ccffcc width=60>#"&right("0000" & cstr(iNo),4) &"</td>"

if MAIL ="" then
sWriteBuf = sWriteBuf & "<td bgcolor=#ccffcc>" & NAME& "</td>"
else
sWriteBuf= sWriteBuf & "<td bgcolor=#ccffcc><a href=" & Chr(34) & "mailto:" & MAIL & Chr(34) & ">" & NAME & "</a></td>"
End if

sWriteBuf=sWriteBuf & "<td bgcolor=#ccffcc width=120 align=center><font size=2>" & EDate &"</font></td></tr></table>"
sWriteBuf=sWriteBuf & "<table cellpadding=4 width=100% border>"
sWriteBuf=sWriteBuf & "<tr><td bgcolor=#cccccc colspan=3>" & title & "</td></tr>"
sWriteBuf=sWriteBuf & "<tr><td bgcolor=white colspan=3>" & MSG & "</td></tr>"
sWritebuf=sWriteBuf & "</table><br>"

set OutStream=objFile.CreateTextFile(LogFile,True)
OutStream.WriteLine sWriteBuf
OutStream.Write sOldLog
end sub
sub Disp
SetInStream=objFile.OpenTextFile(FormFile,1,False)
buf=InStream.ReadAll
Response.Write Buf
InStream.Close
set InStream=objFile.OpenTextFile(LogFile,1,False)
buf=InStream.ReadAll
Response.Write buf & "<hr>全部で" & InStream.line-1 & "件のメッセージが登録されています。<hr>"
Response.Write buf & "<hr>"
InStream.close
end sub
</script>
------------------------------------------------------------

XP proのiis上でasp掲示板を勉強中です。   jimnyさん [2004/02/24 15:46:58] [4079]
  Re:XP proのiis上でasp掲示板を勉強中です。   Lightningさん [2004/02/26 16:20:51] [4081]
    発言者により削除されました!! jimnyさん [2004/02/27 23:30:48] [4085]
    返信ありがとうございます。   jimnyさん [2004/02/27 23:32:48] [4086]
      Re:返信ありがとうございます。   Lightningさん [2004/03/01 10:47:19] [4093]
        ありがとうございます。   jimnyさん [2004/03/01 21:26:53] [4096]
  Re:XP proのiis上でasp掲示板を勉強中です。   YasNet(管理人)さん [2004/02/27 20:54:09] [4084]
    返信ありがとうございます。   jimnyさん [2004/02/27 23:42:58] [4087]
      Re:返信ありがとうございます。   YasNet(管理人)さん [2004/02/28 15:20:09] [4088]
        ありがとうございました。   jimnyさん [2004/03/01 10:15:13] [4092]


TreeBBS For ASP V.0.1.3
Program By YasNet