Привет, я пытаюсь отправить какую-либо форму обратно человеку, который заполняет эти формы в качестве ссылок. Однако я продолжаю получать ошибки в строке 5. Что я не вижу в этом никаких проблем. Может ли кто-нибудь вести меня? Благодаря!Проблема с заполнением формы
<?php session_start();
require_once 'opendb.php'
$subject = "Refrence";
$refemail = "Here is the list for your refrence";
$class_name = $_POST['course_name'];
$class_venue = $_POST['class_venue'];
$date_of_lesson =$_POST['date_of_lesson'];
$time_of_lesson =$_POST['time_of_lesson'];
$class_duration =$_POST['class_duration'];
$date_of_exam =$_POST['date_of_exam'];
$class_in_charge =$_POST['class_in_charge'];
$contact =$_POST['contact'];
$email =$_POST['email'];
$zone =$_POST['zone_no'];
$cl_name =$_POST['cl_name'];
$ce_name =$_POST['ce_name'];
$todayis = date("l, F j, Y, g:i a") ;
$message = " $todayis \n
From: $cl_name ($email)\n
Class name: $class_name \n
Class Venue: $class_venue \n
Date of lesson: $date_of_lesson \n
Time of lesson: $time_of_lesson \n
Class duration: $class_duration \n
Date of exam: $date_of_exam \n
Class in charge: $class_in_charge \n
Contact: $contact \n
Zone: $zone \n
Cl Name: $cl_name \n
Ce Name: $ce_name \n
";
$from = "From: $email\r\n";
mail($email, $subject, $refemail, $message, $from);
?>
<img style="width: 190px; height: 184px;" alt=""
src="images/Picture1.jpg">
<form enctype="multipart/form-data" action = 'function.php' method='post' />
</head>
<body>
<span
style="text-decoration: underline; font-weight: bold;"> </span>
<head><title>Success!</title></head>
<h1>Class Successfully Created !</h1>
<h3>Thank you. An email has been sent to your account for futher reference.</h3>
<?
// Read variables from the $_POST array
$i = 0;
while ($i < $_SESSION['numberOfStudents'])
{
$student_name = $_POST['student_name'.$i.''];
$classId = $_SESSION['class_id'];
$nric = $_POST['nric'.$i.''];
$age = $_POST['age'.$i.''];
$sql = "INSERT INTO b_student (bs_nric_no,student_name,age,b_class_id) VALUES
('$nric','$student_name','$age','$classId')";
mysql_query($sql) or die(mysql_error());
$i++;
}
?>
<tr>
<td></td>
<table style="text-align: left;"
<td><input type = 'submit' value = 'Back to Function List!'></td>
</tr>
</table>
</form>
</html>
</body>
</html>
Я думаю татами был проблема и теперь я получаю новую ошибку. «undefine index for all variables» – 2009-07-19 09:42:44
Проверьте, как выглядит ваш POST, просто введите var_dump ($ _ POST); – usoban
Ухаживать за подробностями? Извините, что я не очень хорош в этом. – 2009-07-19 10:32:41