How do I get user-inputted information from the website directly to my e-mail?

Tags: javascript,php,html,css,real-time-updates

Problem :

So I've decided to make a website a few months ago and have then picked up basic HTML, CSS, Javascript and Jquery. Now I want to do two things with my website,

  1. show a user-voted poll somewhere on my website that will update live as the users vote on different optinos.
  2. 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?

Solution :

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)
  • etc...

Sending mail with PHP is documented here:

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:

<form action='send_mail.php'>.....</form>

And this script will retrieve the form data and handle the mail sending, e.g:

    $data = $_POST; // contains the form's input values
    mail("", "Notification mail", "A form has been submitted with some data: ".$data["fieldName"]);

    CSS Howto..

    CSS - How to position a fixed sidebar div relatively to a centered content div

    How to add JS and CSS file in web page based on parameter?

    How to use CSS to show rotated text in a table cell

    How to style a SVG using CSS in javaFX FXML

    how to apply css on specific td on first tr

    How to move Woocommerce Description tab below review tab

    How to keep control-specific css with the control code (ASP.NET)

    How can I make an element fit to fill the right part of the window?

    HTML emails in 2013: How to control spacing between elements like paragraphs and images?

    How can I fix the menu on the implanted header?

    How to horizontally center text in bootstrap button?

    How to add css loading animation in ajax beforeopen page

    How to disable CSS minifier in Liferay?

    How to change an image on mouseover of wrapper div

    How do I get the (element with the) highest CSS z-index in a document?

    How to remove “pictureframe” in Internet Explorer?

    How to vertically center links in a menu?

    Css how to create navigation bar

    How to get ratio of scale image, when it's autoscaled by background-cover?

    CSS animate — how to fill div from center

    How to make google maps fit the mobile device screen

    How to create a level 4 submenu with this css?

    How to convert HTML button to HTML input, while keeping all CSS?

    How can I use CSS to make a multi-select box but have the label appear on top instead of to the left?

    How to get a jQuery modal overlay to not push the scrollbar around?

    How to change the slide picture when resize browser size

    How to change the colors of HTML form elements displayed in UIWebView?

    How to wrap Font-Awesome with CSS?

    How do I stop internet explorer's propriety gradient filter from cutting off content that should overflow?

    Bootstrap: user agent css styles misbehaving how to solve this