通过HTML按钮触发PHP函数

I have a conmysql.php with this function:

function addTeacher($idTeach,$nameTeacher,$teacherDay){


    $adicionar = sprintf("INSERT INTO `test`.`teacher` (`$idTeacher`, `$nameTeacher`, `$teacherDay`) VALUES ('$idTeacher', '$nameTeacher', '$teacherDay');");
    $queryadd  = mysql_query($adicionar);
}

I'm filling these variables with 3 forms, and it's working but i don't know how to trigger the addTeacher (); on a HTML button.

I should use AJAX? If yes, how?

查看全部
dounieqi6959
dounieqi6959
2013/09/12 04:15
  • php
  • html
  • javascript
  • 点赞
  • 收藏
  • 回答
    私信

2个回复