我试图通过提交按钮调用一个函数,但我无法提交它。
<!DOCTYPE html>
<html>
<body>
<h2>API Call</h2>
<form method="post" action="display()">
<label for="gid">Global Device ID:</label><br>
<input type="text" id="gid" name="gid" value="m99002021" readonly><br>
<label for="type">Type:</label><br>
<input type="text" id="type" name="type" value="EVNT" readonly><br><br>
<label for="start">Start Date Time:</label><br>
<input type="text" id="start" name="start" value="2020-09-01 00:00:00" readonly><br><br>
<label for="end">End Date Time:</label><br>
<input type="text" id="end" name="end" value="2020-09-30 23:59:59" readonly><br><br>
<input type="submit" value="Execute">
</form>
<?php
function display()
{
echo "hello".$_POST["gid"]."<br>";
echo "hello".$_POST["type"]."<br>";
echo "hello".$_POST["start"]."<br>";
echo "hello".$_POST["end"]."<br>";
}
if($_SERVER['REQUEST_METHOD']=='POST')
{
display();
}
?>
</body>
</html>
单击按钮时,execute我得到以下页面
网址是file:///C:/Users/Faisal/Desktop/display()
子衿沉夜
30秒到达战场
RISEBY
相关分类