A
A
Arman4ik2019-05-30 23:43:10
JavaScript
Arman4ik, 2019-05-30 23:43:10

How to transfer data from LocalStorage to the server?

There is a site, on the site, goods are loaded through a cycle in JS from a JSON file. And the bottom line is that when you click "add to cart", the data gets into LocalStorage (key + value). What can be done to make the user send this data + phone number and name (and all without PHP)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Immortal_pony, 2019-05-31
@Arman4ik

Where do you want to send user data?
You can, for example, just by mail: https://www.smtpjs.com/

<script src="https://smtpjs.com/v3/smtp.js">
</script>

Email.send({
    Host : "smtp.yourisp.com",
    Username : "username",
    Password : "password",
    To : '[email protected]',
    From : "[email protected]",
    Subject : "This is the subject",
    Body : "And this is the body"
}).then(
  message => alert(message)
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question