在下一行
<form method="post" action="display()">
该动作应该是脚本的名称,并且应该调用该函数,就像这样
<form method="post" action="yourFileName.php"> <input type="text" name="studentname"> <input type="submit" value="click" name="submit"> <!-- assign a name for the button --></form><?phpfunction display(){ echo "hello ".$_POST["studentname"];}if(isset($_POST['submit'])){ display();} ?>


