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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question writing data to txt file on external server

    well i'm kind of new to this website and scripting with javascript but i am wondering:
    in a client side .js file i have some coding which results in a string which is stored in a variable called exportData

    now i want that string to be written into a text file on a server but how do i do that?
    it is not local on the client's pc and i can't find how to do it anywhere...
    can you guys help me?

    greetings,
    Fady
    Last edited by Fadyselim; 12-18-2011 at 03:17 PM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,013
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), communicate with the server, access a database, the client's operating system or the Windows registry, or alter the default behaviour of the browser.


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but then how can i do this?
    is there any way to do this from my javascript file?
    i have a php website hosted on a server and that's where i want to send it to
    have you got a clue on how to do this then?

    greetings,
    Fady

  • #4
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,267
    Thanks
    10
    Thanked 277 Times in 276 Posts
    I think he said it, you need to use Ajax (Javascript+PHP) to do it.

    Dave

  • #5
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ow sorry, couldn't really find that in.his post
    Thank you, both of you

    Greetings,
    Fady


  •  

    Posting Permissions

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