när jag kör min gäst bok på datorn så funkar allt bra...... men på brinkster.com så står det bara....... en missvisande kommentar tidigare refererade till server.mappath(). Du skall här ange filnamnet - rutinen returnerar sedan både filnamn och sökvägen.problem
Microsoft VBScript runtime error '800a0035'
File not found
/imessu/default.asp, line 17
gästboken består av 3 filer:
DEFAULT.ASP:
<html>
<head>
<meta http-equiv="Content-Language" content="sv">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>XBOOK</title>
</head>
<body>
<%
Server.Mappath("\..\")
Dim F, T, N
NR = 0
Set F = CreateObject("Scripting.FileSystemObject")
Set T = F.OpenTextFile("data.txt")
Do Until T.AtEndOfLine
temp1 = T.ReadLine
temp2 = T.ReadLine
temp3 = T.ReadLine
temp4 = T.ReadLine
N = N + 1
Loop
T.Close
If N = "" Then N = 0
%>
<p align="center"><font face="Arial Black" size="7">Gästbok</font><font size="6" face="Arial Black"><br>
</font><font size="2" face="Arial">Skriv i min gästbok</font></p>
<hr>
<p align="left"><font size="3"><b>Antal inlägg: </b><%=N%></font> </p>
<p align="left"><font size="5"><b>Inlägg:</b></font> </p>
<hr>
<%
Set F = CreateObject("Scripting.FileSystemObject")
Set T = F.OpenTextFile("data.txt")
Do Until T.AtEndOfLine
temp1 = T.ReadLine
temp2 = T.ReadLine
temp3 = T.ReadLine
temp4 = T.ReadLine
%>
<b>Namn:</b> <%=temp1%><br>
<b>e-Mail:</b> <%=temp2%><br>
<b>Hemsida:</b> <%=temp3%><br>
<b>Kommentar:</b> <%=temp4%><br>
<hr>
<p> </p>
<%
Loop
T.Close
%>
<p align="left"><a name="write"></a>Skriv ett inlägg:</p>
<form method="POST" action="sender.asp">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="18%">Namn:</td>
<td width="82%"><input type="text" name="T1" size="40" value="Noname"></td>
</tr>
<tr>
<td width="18%">e-Mail:</td>
<td width="82%"><input type="text" name="T2" size="40" value="email@server.com"></td>
</tr>
<tr>
<td width="18%">Hemsida:</td>
<td width="82%"><input type="text" name="T3" size="40" value="http://"></td>
</tr>
<tr>
<td width="18%">Kommentar:</td>
<td width="82%"><input type="text" name="S1" size="79" value="Medelande....."></td>
</tr>
</table>
<p align="left"><input type="submit" value="Skicka" name="B1"><input type="reset" value="Återställ" name="B2"></p>
</form>
<p align="center"><font size="1">XBOOK(c) Coded by Tim Hegyi<br>
Copyright(c) 2000</font></p>
</body>
</html>
===========================================
SENDER.ASP
<head>
<meta http-equiv="Refresh" Content="2;URL=default.asp">
<title></title>
</head>
<body bgcolor="#FFFFCC">
<%
Server.Mappath("\..\")
Application.Lock
On Error Resume Next
Dim Obj, TS, a, b, c, d
Set Obj = CreateObject("Scripting.FileSystemObject")
If Obj.FileExists("data.txt") = False Then
Set TS = Obj.CreateTextFile("data.txt", 8)
Else
Set TS = Obj.OpenTextFile("data.txt", 8)
End If
a = Request.Form("T1")
b = Request.Form("T2")
c = Request.Form("T3")
d = Request.Form("S1")
If Len(a) > 0 And Len(b) > 0 And Len(c) > 0 And Len(d) > 0 then
TS.WriteLine a
TS.WriteLine b
TS.WriteLine c
TS.WriteLine d
%>
<p> </p>
<table border="0" width="100%" cellspacing="0" cellpadding="0" bordercolorlight="#66CCFF">
<tr>
<td width="26%">
<p align="right"><font size="3" face="Arial"><b>Status:</b></font></td>
<td width="74%"></td>
</tr>
<tr>
<td width="26%">
<p align="right"></td>
<td width="74%"><font size="5" face="Arial" color="#008080"><b>Medelande
sänt... Ok.</b></font></td>
</tr>
<tr>
<td width="26%">
<p align="right"><font size="3" face="Arial"><b>Medelande:</b></font></td>
<td width="74%"></td>
</tr>
<tr>
<td width="26%"></td>
<td width="74%"><font face="Arial" size="5" color="#008080"><b>Tack för din
åsikt. Vänta...</b></font></td>
</tr>
</table>
<%
Else
%>
<p> </p>
<table border="0" width="100%" cellspacing="0" cellpadding="0" bordercolorlight="#66CCFF">
<tr>
<td width="26%">
<p align="right"><font size="3" face="Arial"><b>Status:</b></font></td>
<td width="74%"></td>
</tr>
<tr>
<td width="26%">
<p align="right"></td>
<td width="74%"><font size="5" face="Arial" color="#008080"><b>FEL...</b></font></td>
</tr>
<tr>
<td width="26%">
<p align="right"><font size="3" face="Arial"><b>Medelande:</b></font></td>
<td width="74%"></td>
</tr>
<tr>
<td width="26%"></td>
<td width="74%"><font face="Arial" size="5" color="#008080"><b>Du måste
fylla i alla text rutor. Vänta...</b></font></td>
</tr>
</table>
<%
End If
TS.Close
Application.UnLock%>
</body>
==========================================
DATA.txt
Noname
email@server.com
http://
Medelande.....
Noname2
email@server.com2
http://2
Medelande.....2
Vad är felet...... HJÄLP!!!!!!!!!!!!Sv: problem
fil = server.mappath("textfil.txt")
response.write fil
kan vara:
c:\inetpub\wwwroot\textfil.txt
/Pelle