How do I get user-inputted information from the website directly to my e-mail?
- show a user-voted poll somewhere on my website that will update live as the users vote on different optinos.
- A form on my website that when the user fill out and click the "submit" button, the form will automatically be forwarded to my desired e-mail address
I've been told to learn PHP because it's suppose to help my problem, but so far I have yet to see how it's going to help me solve the above two problems. Any suggestion on how I can achieve the two things above??
PS: if someone can explain what exactly is PHP, I will also be really grateful. I've been looking up what PHP is and the majority of the responses I get is "it's a server side language", which is not exactly helpful. And if PHP does help me solve the two questions above, how?
PHP is actually a "server side language" (mostly) :)
It means that it allows your web server to be smart, i.e:
- load/read data from a database
- send emails
- generate pages dynamically (instead of just serving static pages)
Sending mail with PHP is documented here: http://us2.php.net/manual/en/function.mail.php
Basically in your HTML you'll tell your form to be posted to a specific PHP script which is hosted on your web server, e.g:
And this script will retrieve the form data and handle the mail sending, e.g:
<php> $data = $_POST; // contains the form's input values mail("firstname.lastname@example.org", "Notification mail", "A form has been submitted with some data: ".$data["fieldName"]); </php>