Results 1 to 14 of 14

Thread: a news form

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    14

    Lightbulb

    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

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    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

    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>
    Mark
    -------------------

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    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]
    Mark
    -------------------

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    14

    this

    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    14

    help again

    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

  6. #6
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    what is being output to the browser?



    Mark
    -------------------

  7. #7

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    14

    think i know

    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

  8. #8
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    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

    Mark
    -------------------

  9. #9

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    14

    No

    No i didn`t.
    where can i find that program?
    en how do i know if a ISP has it?
    grtz
    thatsmej

  10. #10
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    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.



    Mark
    -------------------

  11. #11
    Lively Member
    Join Date
    Feb 1999
    Location
    Leicester, UK
    Posts
    123
    Yes - it is on the 98 CD, in the Add-ons folder. I am running it on 98.

  12. #12

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    14

    got it

    oke i`ve got it right now
    whats next?
    thatsmej

  13. #13
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    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
    Mark
    -------------------

  14. #14

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    14

    nope

    nope,
    when i do that my frontpage 2000 comes up
    :-(
    grtz
    thatsmej

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width