嗨,我正在使用PHP执行python脚本,但我不想在点击按钮时刷新页面,因为我也嵌入了其他页面[关闭]

This is the php and html code I am using motion to stream video in it

<html>

<head>

<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="css/style.css">

</head>

<?php

if (isset($_POST['LightBLINK']))
{
exec("sudo python /var/www/html/open.py");
}

?>

<form method="post">
<button class="btn" name="LightBLINK">Light BLINK</button><br><br></form> 

<body>

<h1>Raspberry Pi Webcameras</h1>
<a href="http://192.168.1.3:8081/">
<img src="http://192.168.1.3:8081/" alt="Camera 1" ></a>
<a href="http://192.168.1.3:8082/">
<img src="http://192.168.1.3:8082/" alt="Camera 2" ></a>

</body>

</html>

The problem is that when I click the "LIGH BLINK" button it executes the open.py script but along with it the complete web page refreshes which causes the embedded pages(video in my case) to refresh.

The thing i want is that when i click the "LIGHT BLINK" button it should execute the open.py script as before . but donot refresh the whole page so that my video feed remains undisturbed.

查看全部
dtp19819
dtp19819
2016/07/18 14:53
  • python
  • php
  • html
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复