Heres what I'd like to accomplish and I believe I have to use server side script to do it.
I have a website where there is a question and then a text field below it to type in the answer to the question. When you click submit I'd first like it to tell the user if you submitted the correct answer, and second if the correct answer is submitted I'd like an email message to be sent to me letting me know the correct answer was submitted.
markus is right there are many ways to do this.
1. To do the validation of the question you do not need a server-side script, but you can use one if you want.
2. To send an e-mail you do.
The PHP could look something like this
[PHP]
<?php
session_start();
//I decided to user sessions to store the person who is going to answer
//the question, because I doubt you will want anonymous people
//spamming your mail box. I have a feeling that you want to restrict
//this to a few people.
$user = $_SESSION['user'];
$answer = "answer";
//check to see if the user actually submitted the answer
if (isset($_POST['answer'])) {
//INSERT some POST variable validation here
// or you can open yourself up to a lot of security vulnerabilities
if ($answer == $_POST['answer']) {
//send e-mail using mail function
//compile your e-mail message
$to = "youremail@example.com";
$subject = "Correct answer";
$message = "$_SESSION['user'] answered the question correctly";
mail($to, $subject, $message);
//set a message for your user to see
echo "Correct answer. Congratulations";
}
}
else {
echo "Incorrect answer. Please try again";
}
?>
[/PHP]
This is just the general idea, and you can make this as complicated or simple as you want.