K
K
KVS172015-01-02 11:28:28
JavaScript
KVS17, 2015-01-02 11:28:28

How to give a link in exchange for a visitor's email?

It is necessary to implement the functionality with as little effort as possible.
Task: get the visitor's email and give him a link to download the file.
no CMS.
%D0%9E%D0%9E%D0%9E-%D0%AE%D0%A3%D0%9C%D0

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
KVS17, 2015-01-02
@KVS17

connected unisender and set up emails by event

P
Pavel Gogolinsky, 2015-01-02
@gogolinsky

1) With no email validation Make
a form. Make an input with type=email and name="email" so that you enter the exact email. And add a type=submit button. In the form handler, make conditional if ($_POST["email"]) ...
2) With validation.
Make a database with three fields id, email, authkey
Accept email, save it to the database. Generate a random authkey and save. Generate a link like
http:://yourdomain.ru/getCatalog?email=<saved email>&authkey=<saved key>. Send this link to the specified email. When following this link, there should be a check: does the email and authkey pair exist in the database. If yes, you return the directory, if not, you throw an error.

R
Rsa97, 2015-01-02
@Rsa97

Generate a random code, write it to the database along with the e-mail address and send a link like "get?mail={$mailhash}&code={$code}" to this address.
If you want even less effort - just give a link without asking for an e-mail. Or is this directory so secret?

A
Alexander, 2015-01-02
@NeiroNx

The easiest way is to send a link to an e-mail - if you entered not your own, then you won’t see the link - the motivation to enter a valid e-mail. And the load on the mailers is not big. A letter with a large file can easily get lost.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question