Forum Moderators: coopster
[edited by: coopster at 2:58 pm (utc) on Jan. 30, 2006]
[edit reason] Removed basic html form code [/edit]
You can gain a lot of knowledge in this Forum, and there are some basic guidelines [webmasterworld.com] that help us all.
To specifically address your question, have a look at the following thread from our Library [webmasterworld.com].
Basics of Submitting and Emailing Forms with PHP [webmasterworld.com]
what you seek is very easy to implement, first of all you need to gather variables(data) submitted on the form and store them in the db, right after the 'storage' query (on the same script) and within your validation code (check if data inserted into DB) if data is inserted successfully send the e-mail using the exact same variables
Logic:
$query_store = "insert INTO courses (course_name, course code, student_id) VALUES ('".$_POST['course_name']."', ....., '".$_POST['student_id']."')";
$run_store = mysql_query($query_store) or die (mysql_error());
if (!run_store)
{
echo "error";
}
else
{
$to = 'someone@someone.com';
$subject = "blablabla $student_name in $course name.................";
$message ="Course subscription: $course_id\nStudent: $student_name\n...........";
mail($to, $subject, $message);
}
This code is pretty much what you need according to your problem (demo code though)
Hope the best