error page
这是页面的图像错误
这是validation.js
function delete_student(st_id){
if(confirm("Do you want to delete the student?")){
this.document.student_view.st_id.value = st_id;
this.document.student_view.st_act.value= "delete_student";
this.document.student_view.submit();
}
}
这是student.php
function delete_student(){
$SQL = "DELETE FROM student WHERE st_id = $_REQUEST[st_id]";
$rs= mysql_query($SQL) or die(mysql_error());
if($rs)
{
header("Location:../student_view.php?msg=Student Deleted succesfully");
}
}
?>
这是student_view.php
<?php
while($data= mysql_fetch_assoc($rs))
{
?>
<tr>
<td><?=$data['st_id']?></td>
<td><?=$data['st_name']?></td>
<td><?=$data['st_father']?></td>
<td><?=$data['st_mobile']?></td>
<td>Edit | <a href="Javascript:delete_student(<?=$data['st_id'] ?>)">Delete</a></td>
</tr>
<?php } ?>
</table>
<input type="hidden" name="act" />
<input type="hidden" name="st_id">
</form>
<?php include_once("includes/footer.php"); ?>
当我检查控制台时,我正在解决如下错误。
Uncaught TypeError: Cannot set property 'value' of undefined at delete_student
当我检查控制台时,我正在解决如下错误。
Uncaught TypeError: Cannot set property 'value' of undefined at delete_student