Writing to txt file on website

Hello. Is it possible to use javascript to write information to a log file that’s on an external site? What I want to do is have a person put their name and birthday into a form on my site, and then output that information to a partnering site’s log file which would be something like www.whatever.com/whatever.file

Is this possible? what file type can javascript write to? I put .file because I am unsure. Thank you!

JavaScript is a client-side scripting language that runs in the visitor’s browser. It cannot write files to any website. You need to use a server-side language to write files on that server’s hard drive.

Javascript can’t be used to write any data? What about on the page itself?
What if I wanted users to write their names in a textbox and onclick of submit button it is posted to the page?
But I want it to be there permanently, not just for the time being. So I can compile a list of names.

The page the form submits to can record the name. It takes 3 lines of PHP code to append to the end of a file.

so basically what you’re saying is that you cannot gather data solely with javascript? you need a server-side scripting language no matter what?

That is correct. You cannot gather data that you want to store on a server solely with JavaScript.

A server is just a computer. My web browser can’t create files on that other computer any more than it can create files on YOUR computer.

Thanks for your help Dan :slight_smile: