Answer the question
In order to leave comments, you need to log in
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.
Answer the question
In order to leave comments, you need to log in
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.
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?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question