1
Sterowanie i Wizualizacje / Odp: Sterowanie przez komórke
« dnia: Maja 21, 2016, 09:09:01 pm »
Thank you very much, you make my day
It is working again with the zip file.
It is working again with the zip file.
Powrót do strony głównej: www.edom-plc.pl
<?php
IF ($_REQUEST['TYPE']=='READPI') {
$url = "http://www.mysite.com/READPI?ADR=" . $_REQUEST['ADR'] . "&FORMAT=" . $_REQUEST['FORMAT'] ;
};
IF ($_REQUEST['TYPE']=='WRITEPI') {
$url = "http://www.mysite.com/WRITEPI?ADR1=" . $_REQUEST['ADR1'] . "&VALUE1=" . $_REQUEST['VALUE1'] . "&FORMAT1=" . $_REQUEST['FORMAT1'] ;
};
$handle = fopen($url,"r") ;
$contents = stream_get_contents($handle) ;
fclose($handle) ;
echo $contents;
?>
$. posten ('http://www.mysite. com: 8080/READPI ',
Ik get it from a PHP page > $.ajax({
type: 'GET',
url: "http://www.mysite.com/wago.php",
data: {ADR: $(this).data('address'), FORMAT1: "%d"},
ajaxParent: $(this),
success: function(data){
this.ajaxParent.append(data)
<?php
$url = "http://www.mysite. com: 8080/READPI?ADR=" . $_REQUEST['ADR'] . "&FORMAT1=" . $_REQUEST['FORMAT1'] ;
$handle = fopen($url,"r") ;
$contents = stream_get_contents($handle) ;
fclose($handle) ;
echo $contents;
?>
I do hope there is no risk of somebody hacking you site when now you have the address posted publicly
<script language="JavaScript">
var int=self.setInterval("varupdate()",1000);
function varupdate()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","tag_list.XML",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.getElementById("MW0").innerHTML="Datum en tijd van PLC (UTC): " + xmlDoc.getElementsByTagName("var1")[0].childNodes[0].nodeValue;
document.getElementById("MW1").innerHTML= xmlDoc.getElementsByTagName("var2")[0].childNodes[0].nodeValue;
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#Button1').click(function() {
$.post('http://www.mysite.com:8080/READPI',
{ADR: 'QX6.0', FORMAT1: '%d'},
function(data){$('#Result').append(data);
}
);
});
});
</script>
</Head>
<body>
<Div id ="Button1" > Kilknij mij! </div>
<Div id ='Result'></div>
</Body>
</Html>