Kind of new at this, so please bear with me:
i wrote out this:
<?php
require_once ('../../mysql_connect.php'); // Connect to the database.
// Include the configuration file for error management and such.
require_once ('ce_includes/config.inc');
// Set the page title and include the HTML header.
$page_title = 'ACA Community Education | Course Information';
include_once ('ce_includes/ce_header.html');
if(@isset($POST['submit']) && @$POST['submit'] == 'Send')
{
// Do your input validation, and variable instantiation here....
mail($instructor_email, $combo_course, $body, "From: ".$student_email);
}
else
{
// Now do the query and show the form...
$query = "SELECT email FROM student_table WHERE user_id={$_SESSION['user_id']}";
if ($r2 = mysql_query ($query)) { // Run the query.
$row2 = mysql_fetch_array ($r2); // Retrieve the information.
$student_email = $row2['email'];
}
$query = "SELECT * FROM course_table WHERE course_id={$_GET['id']}";
if ($r = mysql_query ($query)) { // Run the query.
$row = mysql_fetch_array ($r); // Retrieve the information.
$course_code = $row['course_code'];
$course_1title = $row['course_1title'];
$course_instructor = $row['course_instructor'];
$combo_course = "$course_code"." "."$course_1title";
}
echo '<h1>Email';
echo ": $course_instructor";
echo '</h1>';
$query = "SELECT * FROM instructor_table WHERE instructor_id={$row['instructor_id']}";
if ($r3 = mysql_query ($query)) { // Run the query.
$row3 = mysql_fetch_array ($r3); // Retrieve the information.
$instructor_email = $row3['email'];
$body = "$body";
}
print
'<form action="'.$_SERVER['PHP_SELF'].'" method="post">
Name: <input type="text" name="name" size="20" maxlength="20"><br />
Subject: <input type="text" name="combo_course" size="50" maxlength="60" value="' . $combo_course . '"><br />
Comments:<br><textarea name="$body" cols="50" rows="10"></textarea><br />
<input type="submit" name="submit" value="Send">
</form>';
}
?>
<?php // Include the HTML footer file.
include_once ('ce_includes/ce_footer.html');
?>
then I get this error when I send:
An error occurred in script /home/kitodesi/public_html/acace/ce_includes/config.inc on line 11: Undefined variable: instructor_emailAn error occurred in script /home/kitodesi/public_html/acace/ce_includes/config.inc on line 11: Undefined variable: student_email