DV1 Posted January 15, 2018 Share Posted January 15, 2018 Hi, it's been awhile since I've posted here. Maybe that's a good thing in that I guess I'm doing things right? :-) Anyway, something that I find confusing is the "process input" when it comes to forms. An example would be a subscription form. Many, many designs out there on the web but few of their authors explain simply how to get the form to work. And by work I mean how to direct the form info to a particular email. In this case it would obviously be an email of mine where I could receive the subscriber's email address. Here is the html code section for a subscription form: <body> <section class="subscribe"> <div class="subscribe-pitch"> <h3>Subscribe</h3> <p>Subscribe to our newsletter to get the latest scoop right to your inbox.<p> </div> <form action="index.html" method="post" class="subscribe-form"> <input type="email" name="email" class="subscribe-input" placeholder="Email address" autofocus> <button type="submit" class="subscribe-submit">Subscribe</button> </form> </section> </body> It looks really good, I've customized it, etc. Now all I need to know is where to place the email where the info is sent. I think it might be a separate PHP page on the server but not sure. I hope someone here has a simple solution. For those wanting more specifics, here is the page from where I got the code. You'll notice in the comments section others asking this same question yet the author doesn't answer. Thank You for any help. Daniel Link to comment Share on other sites More sharing options...
dsonesuk Posted January 15, 2018 Share Posted January 15, 2018 You require a server that uses a server language script (PHP, ASP.net) to process and send the email. For PHP its a short display of minimum required https://www.w3schools.com/php/func_mail_mail.asp OR if you wish to use default email program from users device https://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_mail Link to comment Share on other sites More sharing options...
DV1 Posted January 15, 2018 Author Share Posted January 15, 2018 'dsonesuk', thank you for responding. :-) In the W3 link the first example seems easy enough. So do I make a .php file (with any name on it I guess?) and then upload that along with the form files? What would have to be modified in that example file to refer to the form, and/or the other way around? Daniel Link to comment Share on other sites More sharing options...
Ingolme Posted January 15, 2018 Share Posted January 15, 2018 You probably should read through the PHP tutorial, there's a full section of the tutorial dedicated to form handling: Form Handling Form Validation Form Required Form URL/E-mail Form Complete This is just the basics of building a server application. If you intend to make a mailing list, you'll need a database to store e-mail addresses and probably an admin panel to create the e-mail templates to be sent to the subscribed users. What you're trying to do is not a simple task that can be solved by just copying and pasting code. Link to comment Share on other sites More sharing options...
DV1 Posted January 16, 2018 Author Share Posted January 16, 2018 What I'm trying to do IS a simple task: just have the form send me a simple email with the email address the subscriber put in. I've said nothing about email lists, creating templates and whatnot. And if there were no simple tasks that could be solved by copy and paste then why would W3Schools have loads of "try it yourself" copy and paste solutions just like the link 'dsonesuk' suggested? Read 5 tutorials? I already have the form page ready to go, all I need is a how-to for configuring the file already provided by the suggested link. Link to comment Share on other sites More sharing options...
dsonesuk Posted January 16, 2018 Share Posted January 16, 2018 The trouble is, these simple email options are open to abuse from hackers and spam bots, if you think that won't be a problem you'd be wrong! you WILL receive 100s of spam emails. Without proper validation and sterilization, with addition of some sort of reCAPTCHA forcing user to identify that they are human, by selecting a image or type specific text before submitting takes place. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now