klik di sini
Halaman
Menu
- 10 Jari
- Accessories
- Adobe
- After Effect
- Alamat
- APK
- Beli
- Biner
- BLK
- Blogger
- Bot
- Browser
- C
- Canva
- Capture
- CBT
- Cek
- Cetak
- ChatGPT
- Chrome
- Coding
- Corel
- Crack
- CSS
- Desain
- Domain
- Download
- Driver
- Ebook
- Editing Video
- Element
- Excel
- FastStone
- Fonts
- Form
- Gambar
- Gateway
- GIT
- Gmail
- HMTL
- Icon AppSheet
- IDM
- Install
- Java
- Kajian
- KI-KD
- Logo
- Media
- Ms. Excel
- Ms. Word
- Office
- Partisi
- Penting
- PHP
- Pintaar
- Portable
- Printer
- Psuedocode
- Qur'an
- Repair
- Rubik
- Setting Wifi
- Software
- Tik
- Tutorial
- VB
- VS COde
- Wali Kamar
- Web Browser
- Windows
- Winrar
Kamis, 25 Juni 2020
Minggu, 14 Juni 2020
Java
Klik link berikut .
- Install configurasi java vscode. Installer of Visual Code for Java Developer klik disini
- Install Ekstensi java pack
- Install JDK Oracle
- Install run code
Selasa, 02 Juni 2020
Composer PHP
contoh sintak :
<?php
require_once 'vendor/fzaninotto/Faker/src/autoload.php';
$faker = Faker\Factory::create('id_ID');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>composer</title>
</head>
<h1>Data Penduduk</h1>
<?php for ($i = 0; $i < 10; $i++) : ?>
<ul>
<il><?= $faker->name; ?></il>
<il><?= $faker->address; ?></il>
<il><?= $faker->email; ?></il>
</ul>
<?php endfor; ?>
<body>
</body>
</html>
Senin, 01 Juni 2020
Selected Tanggal Form
<?php
// buat array untuk tanggal
$arr_bln = array(
"1" => "Januari",
"2" => "Februari",
"3" => "Maret",
"4" => "April",
"5" => "Mei",
"6" => "Juni",
"7" => "Juli",
"8" => "Agustus",
"9" => "September",
"10" => "Oktober",
"11" => "Nopember",
"12" => "Desember"
);
// cek apakah form telah di submit
if (isset($_POST["submit"])) {
// form telah disubmit, proses data
// ambil nilai form
$tgl = htmlentities(strip_tags(trim($_POST["tgl"])));
$bln = htmlentities(strip_tags(trim($_POST["bln"])));
$thn = htmlentities(strip_tags(trim($_POST["thn"])));
// siapkan variabel untuk menampung pesan error
$pesan_error = "";
// cek apakah "tgl" < 10
if ($tgl <= 10) {
$pesan_error .= "Maaf, tanggal harus > 10 <br>";
}
// jika tidak ada error, tampilkan isi form
if ($pesan_error === "") {
echo "Form berhasil di proses <br>";
echo "Tanggal dikirim : $tgl - $bln - $thn <br>";
die();
}
} else {
$pesan_error = "";
$tgl = 1;
$bln = "1";
$thn = 2016;
}
?>
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<title>Belajar PHP</title>
</head>
<body>
<h1>Pemrosesan Form</h1>
<?php echo $pesan_error; ?>
<form action="index.php" method="post">
<p>
<label for="tgl">Tanggal Dikirim : </label>
<select name="tgl" id="tgl">
<?php
for ($i = 1; $i <= 31; $i++) {
if ($i == $tgl) {
echo "<option value = $i selected>";
} else {
echo "<option value = $i >";
}
echo str_pad($i, 2, "0", STR_PAD_LEFT);
echo "</option>";
}
?>
</select>
<select name="bln">
<?php
foreach ($arr_bln as $key => $value) {
if ($key == $bln) {
echo "<option value=\"{$key}\" selected>{$value}</option>";
} else {
echo "<option value=\"{$key}\">{$value}</option>";
}
}
?>
</select>
<select name="thn">
<?php
for ($i = 2019; $i <= 2025; $i++) {
if ($i == $thn) {
echo "<option value = $i selected>";
} else {
echo "<option value = $i >";
}
echo "$i </option>";
}
?>
</select>
</p>
<input type="submit" name="submit" value="Proses Data">
</form>
</body>
</html>
// buat array untuk tanggal
$arr_bln = array(
"1" => "Januari",
"2" => "Februari",
"3" => "Maret",
"4" => "April",
"5" => "Mei",
"6" => "Juni",
"7" => "Juli",
"8" => "Agustus",
"9" => "September",
"10" => "Oktober",
"11" => "Nopember",
"12" => "Desember"
);
// cek apakah form telah di submit
if (isset($_POST["submit"])) {
// form telah disubmit, proses data
// ambil nilai form
$tgl = htmlentities(strip_tags(trim($_POST["tgl"])));
$bln = htmlentities(strip_tags(trim($_POST["bln"])));
$thn = htmlentities(strip_tags(trim($_POST["thn"])));
// siapkan variabel untuk menampung pesan error
$pesan_error = "";
// cek apakah "tgl" < 10
if ($tgl <= 10) {
$pesan_error .= "Maaf, tanggal harus > 10 <br>";
}
// jika tidak ada error, tampilkan isi form
if ($pesan_error === "") {
echo "Form berhasil di proses <br>";
echo "Tanggal dikirim : $tgl - $bln - $thn <br>";
die();
}
} else {
$pesan_error = "";
$tgl = 1;
$bln = "1";
$thn = 2016;
}
?>
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<title>Belajar PHP</title>
</head>
<body>
<h1>Pemrosesan Form</h1>
<?php echo $pesan_error; ?>
<form action="index.php" method="post">
<p>
<label for="tgl">Tanggal Dikirim : </label>
<select name="tgl" id="tgl">
<?php
for ($i = 1; $i <= 31; $i++) {
if ($i == $tgl) {
echo "<option value = $i selected>";
} else {
echo "<option value = $i >";
}
echo str_pad($i, 2, "0", STR_PAD_LEFT);
echo "</option>";
}
?>
</select>
<select name="bln">
<?php
foreach ($arr_bln as $key => $value) {
if ($key == $bln) {
echo "<option value=\"{$key}\" selected>{$value}</option>";
} else {
echo "<option value=\"{$key}\">{$value}</option>";
}
}
?>
</select>
<select name="thn">
<?php
for ($i = 2019; $i <= 2025; $i++) {
if ($i == $thn) {
echo "<option value = $i selected>";
} else {
echo "<option value = $i >";
}
echo "$i </option>";
}
?>
</select>
</p>
<input type="submit" name="submit" value="Proses Data">
</form>
</body>
</html>
Langganan:
Postingan (Atom)