Click to See Complete Forum and Search --> : a news form
thatsmej
Nov 24th, 2000, 04:18 AM
Hi does any one of u know how i can make a news form?
i want to make a page when u get there the page will look at a file (news.txt) and show that on the website.
how do i make this?
grtz
thatsmej
Mark Sreeves
Nov 24th, 2000, 05:55 AM
using asp?
whose server is it?
if it's someone elses server then "Scripting.FileSystemObject" might not be available but tit should be ok for pws on your own pc
<%@ Language=VBScript %>
<%option explicit%>
<HTML>
<BODY>
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim Visitor, fso, f,myText
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(Server.MapPath("\news.txt"), ForReading, True)
Do While not f.AtEndOfStream
myText = myText & f.ReadLine & "<BR>"
Loop
f.Close
Response.Write(myText)
%>
</BODY>
</HTML>
Mark Sreeves
Nov 24th, 2000, 06:38 AM
what sort of effect are you trying to achieve?
I presume that using an <iframe> wouldn't suffice.
[Edited by Mark Sreeves on 11-27-2000 at 04:03 AM]
thatsmej
Nov 24th, 2000, 11:11 AM
i want to make something for school that teachers on my school can update the lessons that we are free.
Whitout knowing something about html.
sorry for my english.
grtz
thatsmej
thatsmej
Nov 27th, 2000, 02:27 PM
so this would be the code?
<%@ Language=VBScript %>
<%option explicit%>
<HTML>
<BODY>
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim Visitor, fso, f,myText
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(Server.MapPath("\news.txt"), ForReading, True)
Do While not f.AtEndOfStream
myText = myText & f.ReadLine & "<BR>"
Loop
f.Close
Response.Write(myText)
%>
</BODY>
</HTML>
i probebly need to call the procedure to start it.
because it won`t work now.
can someone please tell me how i should do it?
grtz
thatsmej
Mark Sreeves
Nov 28th, 2000, 02:12 AM
what is being output to the browser?
thatsmej
Nov 28th, 2000, 03:23 AM
hi,
i think i know what`s my problem.
i need to save the code as a news.asp file. and than call the asp file whitin the site.
something like
<FORM ACTION="news.asp" METHOD="GET">
but this won`t work.
can someone tell me what i do wrong??
or give some advise in starting whit asp?
thnx
grtz thatsmej
Mark Sreeves
Nov 28th, 2000, 03:57 AM
OK lets start at the begining...
ASP files contain script which is executed on the server that is anything between the <% %> tags
you need to have (at least) Personal Web Server installed on your PC have you done this?
the page is then accessed throuth the browser
http://[PC-Name]/whatever.asp
thatsmej
Nov 28th, 2000, 11:06 AM
No i didn`t.
where can i find that program?
en how do i know if a ISP has it?
grtz
thatsmej
Mark Sreeves
Nov 29th, 2000, 02:48 AM
Right,
there are sites which will host Active Server Pages I use http://www.ewebcity.com (now called somthing else but you'll be redirected)
Personal Web Server is on NT4 Option Pack , well that's where I got it from anyway.
I believe it is also on the Win 98 cd but I've never installed it on 98 so I suggest you start a new thread asking this.
Michael
Nov 29th, 2000, 03:12 AM
Yes - it is on the 98 CD, in the Add-ons folder. I am running it on 98.
thatsmej
Dec 3rd, 2000, 11:58 AM
oke i`ve got it right now
whats next?
thatsmej
Mark Sreeves
Dec 4th, 2000, 02:19 AM
when you type http://localhost in a browser you sghould get a default page appear
If I remember rightly this is a page in C:\Inetpub\wwwroot on your hard drive. (I think that's where the default page is stored)
anyone else on your network will need to use your pc name instead of localhost to access the pages.
so, put your asp pages in C:\Inetpub\wwwroot and navigate to them eg:
http://localhost/page1.asp
thatsmej
Dec 4th, 2000, 11:51 AM
nope,
when i do that my frontpage 2000 comes up
:-(
grtz
thatsmej
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.