Hallo Ich versuche, ein Formular an die Person, die diese Formulare als Referenzen ausfüllen zurück zu senden. Jedoch bekomme ich immer Fehler in Zeile 5. Was ich sehe kein Problem. Kann mir jemand helfen? Vielen Dank!Formular ausfüllen Problem
<?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>
zugreifen kann ich tat denke, das Problem wurde und jetzt bekomme ich einen neuen Fehler. "undefinierten Index für alle Variablen" –
Überprüfen Sie, wie Ihr POST aussieht, geben Sie einfach var_dump ($ _ POST); – usoban
Pflege um mehr zu erarbeiten? Sorry, ich bin nicht gut in diesem .. –