我创建了一个名为functioncalling.php
的页面,其中包含两个按钮: Submit和Insert。
我想测试当一个按钮被点击时,哪个函数会被执行。我希望输出出现在同一页上。因此,我创建了两个函数,每个按钮一个。
<form action="functioncalling.php">
<input type="text" name="txt" />
<input type="submit" name="insert" value="insert" onclick="insert()" />
<input type="submit" name="select" value="select" onclick="select()" />
</form>
<?php
function select(){
echo "The select function is called.";
}
function insert(){
echo "The insert function is called.";
}
?>
这里的问题是,在单击任何按钮后,我都得不到任何输出。
我到底哪里错了?
https://stackoverflow.com/questions/20738329
复制相似问题