html能触发php函数吗?
html不能触发php函数,html是超文本标记语言,只是用来构建页面结构的,不能触发php的某个函数。
要触发php的某个函数,我们有下面几个实现方法:
● 使用JavaScript来发送ajax请求,触发php的某个函数。
● 利用a标签,刷新页面,并带上一些参数来触发php的某个函数。
具体实现方式如下:
1、使用Ajax来触发php的函数
(1)JavaScript代码
1 2 3 4 5 6 7 8 |
|
(2)test.php文件
1 2 3 4 5 6 7 8 9 |
|
2、利用a标签来触发php的函数
(1)HTML代码
1 |
|
(2)合肥代孕威信15023219993,太原代孕威信15023219993test.php文件同上