PROJEK 4
Materi hari Selasa tanggal 1 November 2022
PROJEK 4
Output
Syntax
Koneksi
<?php
$host = mysqli_connect ("localhost", "root","");
if($host){
echo "Koneksi Ke host berhasil.<br>";
}else{
echo "Koneksi ke host gagal.<br>";
}
$db = mysqli_select_db ($host, "salman3");
if($db){
echo "Koneksi Ke DB berhasil.<br>";
}else{
echo "Koneksi ke DB gagal.<br>";
}
?>
Form
<!DOCTYPE html>
<html>
<head>
<title> Hoby </title>
</head>
<body>
<form method=post action=input.php>
nama : <input type=text name="nama"><br><br>
hoby : <input type="checkbox" name="hoby" value="Bersepeda">Bersepeda<br><br>
<input type="checkbox" name="hoby" value="Joging">Joging<br><br>
<input type="checkbox" name="hoby" value="Basket">Basketan<br><br>
<input type="checkbox" name="hoby" value="Volly">Vollyan<br><br>
<input type="checkbox" name="hoby" value="Gambar">Menggambar<br><br>
<input type=submit value=kirim>
<input type=reset value=reset>
</form>
</body>
</html>
Input
<!DOCTYPE html>
<html>
<head>
<title> Hoby </title>
</head>
<body>
<form method=post action=input.php>
nama : <input type=text name="nama"><br><br>
hoby : <input type="checkbox" name="hoby" value="Bersepeda">Bersepeda<br><br>
<input type="checkbox" name="hoby" value="Joging">Joging<br><br>
<input type="checkbox" name="hoby" value="Basket">Basketan<br><br>
<input type="checkbox" name="hoby" value="Volly">Vollyan<br><br>
<input type="checkbox" name="hoby" value="Gambar">Menggambar<br><br>
<input type=submit value=kirim>
<input type=reset value=reset>
</form>
</body>
</html>
Komentar
Posting Komentar