使用PHP将日期字段传递到MySQL数据库的HTML表单

使用PHP将日期字段传递到MySQL数据库的HTML表单,php,mysql,forms,date,insert,Php,Mysql,Forms,Date,Insert,我遇到的问题是,数据字段(LDA)没有将表单上输入的信息传递到$LDA=date('Y-m-d H:I',strotime($_POST['LDA']));当我查看提交的数据时,不管我提交了什么,我得到的日期是1969-12-31 00:00:00 <form action="sd-drop-submit.php" method="post"> <p> <label>Semester:</label>

我遇到的问题是,数据字段(LDA)没有将表单上输入的信息传递到$LDA=date('Y-m-d H:I',strotime($_POST['LDA']));当我查看提交的数据时,不管我提交了什么,我得到的日期是1969-12-31 00:00:00

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
我使用$lda=date('Y-m-dh:I',strotime($_POST['lda']);因为我得到了一个日期类型错误,并且重新认识到这一定是MySQL需要格式化的日期

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
我有以下非常简单的HTML表单:

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
将来

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
$lda = $_POST (date('Y-m-d H:i', strtotime($_POST['lda'])));
我想我已经很接近了。非常感谢你能得到的任何建议

变化:
<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
$lda=date($Y-m-dh:i',strotime($u POST['lda'])

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
进入:
$lda=date($Y-m-dh:i',strotime($u POST['lda'])

更改:
<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
$lda=date($Y-m-dh:i',strotime($u POST['lda'])

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
进入:

$lda=date($Y-m-dh:i',strotime($u POST['lda'])

您的日期字段名称是大写的。。因此,将表单中的日期字段更改为

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
 <input type="date" name="lda" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
(仅限日期格式-如果该学生从未参加过,请使用该表格。)

您的日期字段名称是大写的。。因此,将表单中的日期字段更改为

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>
 <input type="date" name="lda" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
(仅限日期格式-如果该学生从未参加过,请使用该表格。)

在表格中,您使用的字段名称(大写)如下:

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>

(仅限日期格式-如果该学生从未参加过,请使用该表格。)
在表格中,您使用的字段名称大写字母如下:

<form action="sd-drop-submit.php" method="post">
    <p>
        <label>Semester:</label>    
        <input type="radio" name="semester" value="Spring <?php echo date("Y");?>)">Spring <?php echo date("Y");?>
        <input type="radio" name="semester" value="Summer <?php echo date("Y");?>">Summer <?php echo date("Y");?>
        <input type="radio" name="semester" tooltip="Semester" value="Fall <?php echo date("Y");?>" required="yes" message="Please select the semester." tabindex="1">Fall <?php echo date("Y");?>  
    </p>

    <p>
        <label>Student First Name:</label> 

        <input type="text" name="stdfname" tooltip="Student's First Name" required="yes" message="Please enter the student's first name." tabindex="2"><br>
        <label>Student Last Name:</label> 
        <input type="text" name="stdlname" tooltip="Student's Last Name" required="yes" message="Please enter the student's last name." tabindex="3">
    </p>
    <p>
        <label>Student ID Number:</label>
        <input type="text" name="stdid" tooltip="Student ID Number" message="Please enter the student's ID number." required="yes" tabindex="4">
        <label>Program Code:</label>
        <input type="text" name="program" tooltip="Program Code" message="Please enter the student's program code." required="yes" tabindex="5">
    </p> 

    <p>
        <label>Course:</label> <input type="text" name="course" tooltip="Course" required="yes" message="Please enter the course information." tabindex="6"> (Example: ACA 111, ENG 101)

    </p>
    <p>
        <label>Section:</label> <input type="text" name="section" tooltip="Section" required="yes" message="Please enter the section information." tabindex="7"> (Example: 01, NT1)

    </p>
    <p>
        <label>Last day of Attendance:</label>
        <input type="date" name="LDA" tooltip="Last Day of Attendance" required="yes" message="Please enter the last day of attendance." validate="date" tabindex="8"> (Date Format Only - Please use the <a href="SD_NA.cfm">Never Attended</a> form if this student has never attanded.)<br>
    </p>

    <p>
        <label>Reason:</label>
        <input type="radio" name="reason" tooltip="Reason" value="Employment" required="yes" message="Please select the reason this student is being dropped." tabindex="9">Employment
        <input type="radio" name="reason" value="Excessive Absences">Excessive Absences
        <input type="radio" name="reason" value="Illness (Personal/Family)">Illness (Personal/Family)
        <input type="radio" name="reason" value="Missed Assignments">Missed Assignments
        <input type="radio" name="reason" value="Student Request">Student Request
        <input type="radio" name="reason" value="Other">Other

    </p>
    <p>
        <label>Instructor First Name:</label>
        <input type="text" name="instfname" tooltip="Instructor's First Name" required="yes" message="Please enter the instructor's first name." tabindex="10">
    </p> 
    <p>  
        <label>Instructor Last Name:</label>
        <input type="text" name="instlname" tooltip="Instructor's Last Name" required="yes" message="Please enter the instructor's last name." tabindex="11">
    </p>
    <p>
        <label>Instructor Email:</label>
        <input type="text" name="instemail" tooltip="Instructor's Email" required="yes" message="Please enter the instructor's email." tabindex="12">
    </p>
    <p>
        <label>Comments:</label><br>
        <textarea name="comments" tooltip="Comments" cols="100" rows="5" tabindex="13"></textarea></p>


        <input type="submit" name="Submit" value="Complete the request">
        <input type="reset" name="Reset" value="Reset" id="Reset">
    </p>
</form>

(仅限日期格式-如果该学生从未参加过,请使用该表格。)
确保
$lda
是您认为的。可能不是日期时间字符串。您有多个问题。mysql_uu已从php7中删除。如果可以,您将希望更改为mysqli。你应该使用事先准备好的语句。您的sql注入。确保
$lda
是您所认为的。可能不是日期时间字符串。您有多个问题。mysql_uu已从php7中删除。如果可以,您将希望更改为mysqli。你应该使用事先准备好的语句。您的sql注入。非常感谢。我对PHP编码相当陌生,不知道POST和GET是区分大小写的。我将表单改为小写,它正确地传递了信息。@C.sargrent听起来不错,请在使用前尝试了解每一个新事物。:)非常感谢。我对PHP编码相当陌生,不知道POST和GET是区分大小写的。我将表单改为小写,它正确地传递了信息。@C.sargrent听起来不错,请在使用前尝试了解每一个新事物。:)