Closed Thread Icon

Topic awaiting preservation: Won't work. :( ASP. (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12039" title="Pages that link to Topic awaiting preservation: Won&amp;#039;t work. :( ASP. (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Won&#039;t work. :( ASP. <span class="small">(Page 1 of 1)</span>\

 
At0mic_PC
Bipolar (III) Inmate

From: Columbia MS USA
Insane since: Apr 2001

posted posted 02-07-2002 04:52

I'm new to server side scripting so here is what I want. I want to eventualy be able to write to a text box and then make it write to a text file on my site. My code doesn't work right though. It's supposed to but doesn't.

code:
<%
Set fso = Server.CreateObject("Scripting FileSystemObject")
Set myStream = fso.OpenTextFile("C:\Inetpub\webpub\mytext.txt")
While not myStream.AtEndOfStream
myStream.WriteLine("I wrote a line.")
Wend
myStream.Close
%>



Any ideas? Anyone know where I can get a script that does it already and supports multiple people being able to post news type thingy secure?


God bless,
Atomic

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 02-07-2002 08:15

http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=148

At0mic_PC
Bipolar (III) Inmate

From: Columbia MS USA
Insane since: Apr 2001

posted posted 02-07-2002 16:40

Thanks, but I can get it to create the text file and write to it, but I need it to just write to the text file. Unless your telling me to make my news page script call all of the text files as includes??

God bless,
Atomic

fizgig
Nervous Wreck (II) Inmate

From: West Bloomfield MI
Insane since: Aug 2001

posted posted 02-08-2002 19:22

here is something I did for a guestbook, hope it helps:

WRITING TO THE FILE
' Set up Constants
Const ForAppending = 8 ' Input OutPut mode

' Dimension local variables
Dim MyFile
Dim FSO ' FileSystemObject
Dim TSO ' TextStreamObject

' always use MapPath function to get the Physical Path of file
MyFile = Server.MapPath("book.txt")
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set TS = FSO.OpenTextFile(MyFile, ForAppending, True)
TS.write "<h3>" & comments & "</h3><br>"
if site <> "blank" then
TS.write "<a href=" & site & " target=_blank>"
theName = theName & "</a>"
end if
TS.write theName & "&nbsp;&nbsp;

At0mic_PC
Bipolar (III) Inmate

From: Columbia MS USA
Insane since: Apr 2001

posted posted 02-08-2002 19:55

Thanks, I got it to work on PWS, but it doesn't work in my online web server. (Free) I know with CGI stuff you had to CMOC?? stuff to get it to work right. Is this the same way with things on IIS? Or is it like brinkster where you don't get to script fso? *sigh cfm-Resources.com

God bless,
Atomic

Sash
Paranoid (IV) Inmate

From: Canada, Toronto
Insane since: May 2000

posted posted 02-09-2002 04:49

Certain hosting companies (particularly free ones) disable FileSystemObject so that you have to ask their administrator to enable it for you. Happened to me ones.

sasha &raquo;

sonic_tsunami
Bipolar (III) Inmate

From: some evil place, the evil little atoll
Insane since: Jan 2002

posted posted 02-10-2002 13:49

ASP is evil..that's my opinion...it's evil becuase it's associated more with microsoft and microsoft software.. unix and linux with apache HTTPd works better.

At0mic_PC
Bipolar (III) Inmate

From: Columbia MS USA
Insane since: Apr 2001

posted posted 02-10-2002 16:54

Yes sonic, but I don't run linux or unix so it would be harder for me to get something on my machine that I can test before botching up some one elses machine.

God bless,
Atomic

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 02-10-2002 18:35

You can install all those things (Apache, PHP, Perl, MySQL, etc.) on Windows, too...


« BackwardsOnwards »

Show Forum Drop Down Menu