Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - problem replacing text area on asp file
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum Lockedproblem replacing text area on asp file

 Post Reply Post Reply
Author
JasonsLan View Drop Down
Newbie
Newbie


Joined: 09 August 2005
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote JasonsLan Quote  Post ReplyReply Direct Link To This Post Topic: problem replacing text area on asp file
    Posted: 16 October 2005 at 1:41am
I'm trying to replace the text area in an asp file (pasted below)
but for some reason following the directions doesnt seem to work
the rte is in a folder called "rte" which is a sub folder of the folder that the "edit.asp" script is in.
can anybody tell me what code I need to insert?

Thanks a ton in advance

--Jason

-------------------------
<html>
<head>
<title>View Source</title>
</head>
<body>


<div align="center">
<center>
<table border="0" width="84%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="2">
<form name=edit action="save.asp" method="post">
<textarea rows='15' cols='81' name='file'>
<%
f=request("f")
chkasp = instr(lcase(f), ".asp")
chkhtm = instr(lcase(f), ".htm")
chkhtml = instr(lcase(f), ".html")
chktxt = instr(lcase(f), ".txt")
chktxt = instr(lcase(f), ".php")

if chkasp > 0 or chktxt > 0 or chkhtm > 0 or chkhtml > 0 then
d=request("d")
aa = d & "\" & f
aa = replace(aa, "\\", "\")
MYPath = server.MapPath(aa)
Set Fconn = server.CreateObject("Scripting.FileSystemObject")
Set file = Fconn.OpenTextFile(MYPath,1,false)
output = file.readall
file.close
Set file = nothing
Set Fconn = nothing
Response.Write output
else
response.write "Show only .txt or .asp or. htm or .html or .php files"
end if
%>
</textarea>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
<%
response.write "<input type='hidden' name='d' value='" & request("d") & "'>"
response.write "<input type='hidden' name='MYPath' value='" & MYPath & "'>"
%>
<input type="submit" value="Save"></form>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>

Back to Top
JasonsLan View Drop Down
Newbie
Newbie


Joined: 09 August 2005
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote JasonsLan Quote  Post ReplyReply Direct Link To This Post Posted: 17 October 2005 at 10:36am
nevermind, learned that in the documentation the author specified form name not ID, (its the little things that make all the difference)

Thanks anyways!Wink
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.