-Siapakn editor web (Dreamweaver / Notepad++)
-Install Web server Software misalkan XAMPP
Letakkan code sbb di folder XAMPP/htdocs
Atau silakan ikuti petunjuk dari video sbb:
The Simple code
<?php
session_start();if(!isset($_SESSION["awals"])){
$_SESSION["L1"]="a";
$_SESSION["L2"]="b";
$_SESSION["L3"]="c";
$_SESSION["L4"]="d";
$_SESSION["L5"]="e";
}
?>
<h1><blink><font color="red">Kontrol Lampu VIA WEB</font></blink></h1>
<form name="formControl" method="POST" action="">
<?php
if($_SESSION["L1"]=="a"){
echo'<input type="radio" name="rad" id="rad1" value="A">Lampu 1 OFF<br>';
}
elseif($_SESSION["L1"]=="A"){
echo'<input type="radio" name="rad" id="rad1" value="a">Lampu 1 ON<br>';
}
if($_SESSION["L2"]=="b"){
echo'<input type="radio" name="rad" id="rad2" value="B">Lampu 2 OFF<br>';
}
elseif($_SESSION["L2"]=="B"){
echo'<input type="radio" name="rad" id="rad2" value="b">Lampu 2 ON<br>';
}
if($_SESSION["L3"]=="c"){
echo'<input type="radio" name="rad" id="rad3" value="C">Lampu 3 OFF<br>';
}
elseif($_SESSION["L3"]=="C"){
echo'<input type="radio" name="rad" id="rad3" value="c">Lampu 3 ON<br>';
}
if($_SESSION["L4"]=="d"){
echo'<input type="radio" name="rad" id="rad4" value="D">Lampu 4 OFF<br>';
}
elseif($_SESSION["L4"]=="D"){
echo'<input type="radio" name="rad" id="rad4" value="d">Lampu 4 ON<br>';
}
echo"<hr>";
if($_SESSION["L5"]=="e"){
echo'<input type="radio" name="rad" id="rad5" value="E">ALL OFF<br>';
}
elseif($_SESSION["L5"]=="E"){
echo'<input type="radio" name="rad" id="rad5" value="e">ALL ON<br>';
}
echo"<hr>";
echo'<input type="submit" name="Kirim" id="Kirim" value="Kirim Perintah" />';
?>
</form>
<hr>
<?php
//http://192.168.1.210/?oki
if(isset($_POST["Kirim"])){
$_SESSION["awals"]="Wellcome";
if($_POST["rad"]==A){
$_SESSION["L1"]="A";
die("<script>location.href='http://192.168.1.210/?A';</script>");
}
else if($_POST["rad"]=="a"){
$_SESSION["L1"]="a";
die("<script>location.href='http://192.168.1.210/?a';</script>");
}
else if($_POST["rad"]=="B"){
$_SESSION["L2"]="B";
die("<script>location.href='http://192.168.1.210/?B';</script>");
}
else if($_POST["rad"]=="b"){
$_SESSION["L2"]="b";
die("<script>location.href='http://192.168.1.210/?b';</script>");
}
else if($_POST["rad"]=="C"){
$_SESSION["L3"]="C";
die("<script>location.href='http://192.168.1.210/?C';</script>");
}
else if($_POST["rad"]=="c"){
$_SESSION["L3"]="c";
die("<script>location.href='http://192.168.1.210/?c';</script>");
}
else if($_POST["rad"]=="D"){
$_SESSION["L4"]="D";
die("<script>location.href='http://192.168.1.210/?D';</script>");
}
else if($_POST["rad"]=="d"){
$_SESSION["L4"]="d";
die("<script>location.href='http://192.168.1.210/?d';</script>");
}
else if($_POST["rad"]=="E"){
$_SESSION["L1"]="A";
$_SESSION["L2"]="B";
$_SESSION["L3"]="C";
$_SESSION["L4"]="D";
$_SESSION["L5"]="E";
die("<script>location.href='http://192.168.1.210/?E';</script>");
}
else if($_POST["rad"]=="e"){
$_SESSION["L1"]="a";
$_SESSION["L2"]="b";
$_SESSION["L3"]="c";
$_SESSION["L4"]="d";
$_SESSION["L5"]="e";
die("<script>location.href='http://192.168.1.210/?e';</script>");
}
else{
echo"<hr>PERINTAH TAK DIKENAL !!!!<hr>";;
}
}
?>
Jasa Pembuatan ALat menggunakan Mikrokontroller aneka jenis :Arduino / AVR / MCS / Raspberry PI.
+Support terintegrasi dengan program Mobile (Android, Blackberry, iphone, Java Mobile),
+Support terintegrasi dengan program Desktop (Java,VB.Net , Delphi, VB6, Matlab, Visual C#, Visual C++, Labview dll),+Support terintegrasi dengan program Web (PHP / JSP / Servlet / CGI / Phonegap)
al: Remote Alat Listrik menggunakan Android / Web / Bluetooth / Wireless / PC / SMS / Tone / Suara / Sensor dll
Harga Mahasiswa :http://www.lp2maray.com
Tidak ada komentar:
Posting Komentar