Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    output to txt file

    I am working on a small assignment for a class where I need to have 2 inputs (name text, and message textbox), then store this data in a "forum" type of setting.

    I have this working exactly how I want it in PHP, however the server I must host it on does not allow PHP script so I am being forced to convert this over to javascript.

    I want it so the user inputs their fields, then those fields are added to a (already created) txt file with | as the field seperator. From there I have no problems reading the file and outputting the data as I wish, however I have not been able to find a cross-browser solution to adding the submitted data to the txt file.

    example:
    name: bob
    message: test message

    in txt file, output to >>>

    bob|test message

    Any help would be greatly appreciated.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,310
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    JavaScript is a client-side language and has no ability to read from or write to a file. Only a server-side language such as PHP is able to do this.

  • #3
    New Coder
    Join Date
    Dec 2006
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    could use perl if youre not allowed to use php :D
    http://demo.vegui.org - vegUI AJAX framework
    http://www.landsofkazram.com - browser based graphical MMORPG

  • #4
    New Coder
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    JavaScript is a client-side language and has no ability to read from or write to a file. Only a server-side language such as PHP is able to do this.
    Thats odd, because I can read xml files just fine using the dom, anyway i could use this technology to write as well?


  •  

    Posting Permissions

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