Javascript Write to Textfile

后端 未结 2 1426
轮回少年
轮回少年 2021-01-04 21:27

I\'m trying to take input from a form and save it into a text file that is in the same folder as the html file. This is what I have so far:

2条回答
  •  北海茫月
    2021-01-04 22:03

    In my opinion your entire approach is bad; you need to learn PHP and mySQL to store and load persistent data. - Edit: accessing the file system from JavaScript is a huge security risk and therefore not allowed in general. Unless your goal is specifically to write files from JS, there are better alternatives.

    Anyway, this code will only work on Internet Explorer, and only with the security settings way down. You shouldn't pursue this though.

    If your end goal is to write a web app that stores and displays reservations, get XAMPP and find a beginner PHP + database tutorial.

提交回复
热议问题