Erro html link href
estou tentando montar um projeto em php+html pra um projeto para faculdade em Arduíno, infelizmente entendo quase nada de php.
o problema:
>
Citar
Notice: Undefined index: turn in C:\xampp\htdocs\index.php on line 27Notice: Undefined index: turn in C:\xampp\htdocs\index.php on line 33
<html>
<head>
<title>LED ON/OFF</title>
</head>
<body>
<p align="center">
<font size="8">
<b><a href="led.php?state=1">ON</a></b> /
<b><a href="led.php?state=0">OFF</a></b></font>
</p>
</body>
</html>
<html>
<head>
<title>Arduino Controlled Based PHP</title>
</head>
<body>
<?php
echo "<p>Control Page</p><p>";
$port = fopen("COM7", "w+");
sleep(0);
?>
<br>
<form action="index.php" method="POST">
<input type="hidden" name="turn" value="on" />
<input type="Submit" value="on">
</form>
<form action="index.php" method="POST">
<input type="hidden" name="turn" value="off" />
<input type="Submit" value="off">
</form>
<?php
if ($_POST['turn']=="on")
{
echo "Turned on";
fwrite($port, "n");
}
if ($_POST['turn']=="off")
{
echo "Turned off";
fwrite($port, "f");
}
fclose($port);
?>
</body>
</html>Discussão (1)
Carregando comentários...