Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 26th, 2006, 10:57 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default have check.


Is there any wrong witht his code?

<html>
<head>
<script language="javascript">
        function saved(sel)
        { sel.form.action = "UploadText.asp?mode=save";
                sel.form.submit();
        }
</script>
</head>
<body>
<%
if request.querystring("mode") = "save" then
    dim fs,fname
    set fs=Server.CreateObject("Scripting.FileSystemObject ")
    set fname=fs.CreateTextFile(Server.MapPath(Request.for m("filename")),true)
    fname.WriteLine(Request.form("comments"))
    fname.Close
    set fname=nothing
    set fs=nothing
    Response.write "Done!!!!"
else
    Response.write "Please Use."
end if
%>
<form name="txt" id = "txt" method = "post" onsubmit="UploadText.asp?mode=save">

<input type="text" id = "filename" name= "filename">
<br>
<textarea name="comments" id="comments" rows="30" cols="60"></textarea>
<br>
<input type="button" value="Create" onclick="saved(this);" >
</form>
</body>
</html>

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old May 26th, 2006, 01:20 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Depends on what you mean by the words "any" and "wrong". And the word "is".

There is no validation going on, so if a user submits without entering a file name the Server.MapPath call will fail.



Woody Z http://www.learntoprogramnow.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check programmatically check the password? thomaskelly ASP.NET 1.0 and 1.1 Basics 1 May 16th, 2008 08:49 PM
Connect to VSS check-in Check-out Programatically rhd110 General .NET 6 August 12th, 2007 07:46 AM
Check In / Check Out Nerd_I_Be SQL Server 2005 1 May 7th, 2007 01:15 AM
Help 'Check ListView' vs 'Check ListBox' MikeY C# 1 February 24th, 2005 02:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.