Minggu, 29 April 2018


BSI Purwokerto - Belajar Membuat Web (part 5)

1. Masuk folder htdocs
2. Buat folder dengan nama website_2f



3. Didalam folder website_2f buat folder css dan file dengan nama index.html
disimpan dalam folder website_2f



contoh coding/struktur data index.html

<html>
<head>
<title>Membuat layout WEB responsive sederhana HTML dan CSS</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="header">
<h2>header</h2>
</div>

<div class="nav">
<a href="#">menu 1</a>
<a href="#">menu 2</a>
<a href="#">menu 3</a>
</div>

<div class="row">
<div class="content">
<div class="card">
<h2>Judul artikel</h2>
<h5>Rabu, 22 Februari 2018</h5>
<div class="img" style="height:200px;">Image</div>
<p>Deskripsi deskripsi</p>
</div>
</div>
<div class="sidebar">
<div class="widget">
<h2>Widget 1</h2>
</div>
<div class="widget">
<h2>Widget 2</h2>
</div>
<div class="widget">
<h2>Widget 3</h2>
</div>
<div class="widget">
<h2>Widget 4</h2>
</div>
</div>
</div>

<div class="row">
<div class="footer">
<h2>Footer 1</h2>
</div>
<div class="footer">
<h2>Footer 2</h2>
</div>
<div class="footer">
<h2>Footer 3</h2>
</div>
<div class="footer">
<h2>Footer 4</h2>
</div>
</div>

</body>
</html>







Hasil coding

4. Buat struktur data kemudian simpan dalam folder css dengan nama style



Struktur data syle

* {
box-sizing: border-box;
}

body {
font-family: Arial;
padding: 10px;
background: #f1f1f1;
}

.header {
padding: 10px;
font-size: 40px;
text-align: center;
background: white;
}

.nav {
overflow: hidden;
background-color: #333;
}

.nav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}

.nav a:hover {
background-color: #ddd;
color: black;
}

.content {
float: left;
width: 75%;
}

.sidebar {
float: left;
width: 25%;
background-color: #f1f1f1;
padding-left: 10px;
}

.img {
background-color: #aaa;
width: 100%;
padding: 10px;
}

.card {
background-color: white;
padding: 10px;
margin-top: 10px;
}
.widget{
background-color: white;
padding: 10px;
margin-top: 10px;
}
.row:after {
content: "";
display: table;
clear: both;
}

.footer {
padding: 10px;
width: 25%;
text-align: center;
background: white;
margin-top: 20px;
display: inline-block;
float: left;
}


@media (max-width: 800px) {
.content, .sidebar,.footer{
width: 100%;
padding: 0;
}
}

@media (max-width: 400px) {
.nav a {
float: none;
width:100%;
}
}










Hasil coding





css (caasading style sheet)
1.insline css
2.internal css
3.eksternal css

INLINE CSS
berada dalam sebuah tag (method: style)
<p style="font-size:12px;color:red">
AMIK BSI PURWOKERTO
</P>

INTERNAL CSS
berada dalam satu halaman/file website
<style type="text/css>
p {
font-size:12px;
color:red;
}
</style>
<body>
<p>AMIK BSI PURWOKERTO</P>
</body>

EKSTERNAL CSS
-membentuk file tersendiri berekstensi (.css)
-pemanggil file css diantara tag <head>

<head>
<link rel="stylesheet" type="text/css"
href="style.css">
</head>

p {
font-size"12px;
color:red;
}

h1 {
font-size:18px;
color: blue;
}

PHP=> Hypertext Preprocessor
PHP=> Server side (sisi server) / komputer
PHP=> Untuk pemrosesan data/manipulasi data

syntax php:

<?php -> tag pembuka
...... -> statement
?> -> tag penutup

Contoh penulisan syntax PHP:
-Buatlah folder baru di htdocs dengan nama "belajarphp"
-Buatlah file baru dengan nama "contoh.php" dan isikan di dalamnya:

<?php
echo "Ini adalah contoh penggunaan PHP";
?>


-Simpan dalam folder belajarphp & buka di browser





Variabel PHP

Penulisan variabel:
1.Diawali tanda dollar ($)
2.bersifat Case-sensitive
3.Pengisian nilai variabel menggunakan tanda sama dengan (=)

contoh penulisan variabel:
<?php
$nim=12173488;
$nama="Robin";
?>

-Buatlah sebuah file baru,dengan nama "latihan.php",isikan coding berikut:

<?php
$nim=12173488;
$nama="Robin";
echo "Halo! Nama Saya $nama";
echo "<br>";
echo "NIM saya $nim";
?>

-Simpan dalam folder belajarphp dan buka hasilnya di browser




Tipe Data PHP
-String
-Integer
-Float
-Boolean
-Array

Tipe Data String:
-berbentuk text,bisa angka/huruf/simbol
-diapit oleh tanda petik

Contoh tipe data string:

<?php
$coba="Nomor HP saya 0823454166";
?>

Tipe Data Integer:
-berbentuk angka,bilangan bulat
-tidak perlu diapit tanda petik

contoh tipe data integer:

<?php
$nilaiuts=90;
$nilaiuas=85;
?>

Tipe Data Float:
-berbentuk angka,bilangan desimal/pecahan
-tidak perlu diapit tanda petik

contoh:

<?php
$nilaiuts=80.55;
$nilaiuas=80.77;
?>

Tipe Data Boolean:
-hanya ada 2 nilai:false (salah) atau true (benar)

contoh:
<?php
$x = false;
$y = true;
?>

Tipe Data Array:
-menyimpan banyak nilai variabel

contoh:
<?php
$user=("joko","dwi","mulyanto");
echo $user[0];
?>

Manipulasi String pada PHP

strlen() =menghitung jumlah karakter
str_word_count() =menghitung jumlah kata
strrev() =membalikkan urutan karakter
str_replace() =mengganti kata

contoh:
-Buat file baru dengan nama: manipulasi.php
-Isikan codingnya:

<?php
$nama="Bina Sarana Informatika";
echo strlen($nama);
echo "<br>";
echo str_word_count($nama);
echo "<br>";
echo strrev($nama);
echo "<br>";
echo str_replace("Bina","Tempat",$nama);
?>

-Simpan dan lihat hasilnya di browser


Senin, 16 April 2018


BSI Purwokerto - Belajar Membuat Web (part 4)



Materi Pertemuan 5
#Membuat Form menggunakan tag <table>
1. Aktifkan XAMPP (Apache & MySQL)
2. Buat folder baru di htdocs dengan nama : web2f
3. Buat folder baru di dalam folder web2f dengan nama : webadmin
4. Buat file baru di dalam folder webadmin dengan nama : index.html
5. Ketikkan struktur dasar HTML d dalam file tersebut lalu Simpan
Seperti ini :
Htpp://localhost/web2f/webadmin/
Htpp://localhost/web2f/webadmin/index.html
Catatan :
Tag span <span>…..</span> dan <div>…..</div>
<div> dan <span> keduanya tidak memiliki maksud/tujuan
<div> = block-line (membuat blok/baris baru) <p>, <h1>
<span>= in-line (tidak mmembuat blok/baris baru) <b>, <i>, <u>
<div> sebagai pembatas (materi css) struktur web (header, menu, konten, sidebar, footer)
Buka notepad lalu ketikkan script berikut :
<html>
<head>
<title>Halaman Login Admin</title>
</title>
<body>
<div align="center">
<h2>LOGIN ADMIN</h2>
<table border="0" width="300">
<tr>
<td>Username</td>
<td>:</td>
<td><input type="text" name="tuser"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input type="password" name="tpass"></td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="submit" value="LOGIN" name="blogin">
</td>
</tr>
</table>
</div>
</body>


</html>




<html>
<head>
<title>Beranda - Website 2F</title>
</head>
<body>
<table align="center" border="0" width="900">
<tr>
<td height="90" bgcolor="aqua" align="center" colspan="2"</td>
<h1>SITUS RESMI KELAS 2F</h1>
</tr>
<tr>
<td height="35" bgcolor="yellow" align="center"colspan="2"</td>
<a href="index.html">BERANDA</a>
<a href="profil.html">PROFIL</a>
<a href="galeri.html">GALERI</a>


</tr>
<tr height="300">
<td bgcolor="snow" width="700" align="center"</td>
<p align="justify"</p>
<h4>Selamat Datang di website 2F</h4>
<td bgcolor="aqua" width="200" align="center"</td>
<h4>Komentar Baru</h4>
<p>Ini adalah komentar</p>
<h4>Buku Tamu</h4>
<p>Ini adalah buku tamu</p>
</tr>
<tr>
<td height="25" bgcolor="yellow" align="center" colspan="2"</td>
<p>Copyright 2018 - Situs Resmi 2F Dibuat oleh BSI</p>
</tr>
</table>
</body>
</html>









6. Buat file baru di dalam folder web2f dengan nama : index.html
7. Ketikkan struktur dasar HTML di dalam file tersebut lalu simpan
8. Buat file baru namanya : profil.html di dalam folder web2f, Copy semua coding di dalam file index.html ke dalam file profil.html
9. Buat file baru namanya : galeri.html di dalam folder web2f, Copy semua coding di dalam file index.html ke dalam file galeri.html
Script : <html>
<head>
<title>Profil - Website 2F</title>
</head>
<body>
<table align="center" border="0" width="900">
<tr>
<td height="90" bgcolor="aqua" align="center" colspan="2"</td>
<h1>SITUS RESMI KELAS 2F</h1>
</tr>
<tr>
<td height="35" bgcolor="yellow" align="center"colspan="2"</td>
<a href="index.html">BERANDA</a>
<a href="profil.html">PROFIL</a>
<a href="galeri.html">GALERI</a>


</tr>
<tr height="300">
<td bgcolor="snow" width="700" align="center"</td>
<p align="justify"</p>
<h4>Anda Berada di Profil website 2F</h4>
<td bgcolor="aqua" width="200" align="center"</td>
<h4>Komentar Baru</h4>
<p>Ini adalah komentar</p>
<h4>Buku Tamu</h4>
<p>Ini adalah buku tamu</p>
</tr>
<tr>
<td height="25" bgcolor="yellow" align="center" colspan="2"</td>
<p>Copyright 2018 - Situs Resmi 2F Dibuat oleh BSI</p>
</tr>
</table>
</body>
</html>




<html>
<head>
<title>Galeri - Website 2F</title>
</head>
<body>
<table align="center" border="0" width="900">
<tr>
<td height="90" bgcolor="aqua" align="center" colspan="2"</td>
<h1>SITUS RESMI KELAS 2F</h1>
</tr>
<tr>
<td height="35" bgcolor="yellow" align="center"colspan="2"</td>
<a href="index.html">BERANDA</a>
<a href="profil.html">PROFIL</a>
<a href="galeri.html">GALERI</a>


</tr>
<tr height="300">
<td bgcolor="snow" width="700" align="center"</td>
<p align="justify"</p>
<h4>Anda Berada di Galeri Website 2F</h4>
<td bgcolor="aqua" width="200" align="center"</td>
<h4>Komentar Baru</h4>
<p>Ini adalah komentar</p>
<h4>Buku Tamu</h4>
<p>Ini adalah buku tamu</p>
</tr>
<tr>
<td height="25" bgcolor="yellow" align="center" colspan="2"</td>
<p>Copyright 2018 - Situs Resmi 2F Dibuat oleh BSI</p>
</tr>
</table>
</body>
</html>




Sekian rangkuman materi pertemuan 5 tanggal 09 April 2018.

Minggu, 08 April 2018


BSI Purwokerto - Belajar HTML ( part 3 )




PERTEMUAN 4
Tag Form HTML
<form>…….</form>
Digunakan untuk pemrosesan


Di dalam tag <form> ada beberapa elemen pendukung seperti :
<input>,
<select>,
<option>,
<textarea>,dsb..


Attribute pad tag <form> :
1. Action = menuju link pemrosesan
Contoh : <form action=”proses.html”>
2. Method = get(mengambil nilai) atau post(mengirim nilai)
Contoh : <form method=”get”>
3. Enctype = encoding type, saat digunakan method post.
Contoh : <form enctype=”multipart/form-data”>
(multipart/form-data digunakan bila pemrosesan sebuah form mengandung file/gambar)
4. Name = penamaan form
Contoh : <form target=”FBiodata”>
5. Target = menetukan tempat setelah pemrosesan
Contoh : <form target=”_blank”>
(form akan membuka tab baru setelah pemrosesan)

Attribute tag <input>
1. Name = penamaan tag
2. Disable = menonaktifkan tag
3. Width = mengatur lebar tag (type: image)
4. Height = mengatur tinggi tag (type: image)
5. Size = lebar kolom inputan
6. Maxlenght = mengatur jumlah maksimum karakter
7. Placeholder = keterangan tex dalam tag
8. Required = tag harus diisi
9. Readonly = hanya bisa baca, tidak bisa dirubah
10. Value = isi/nilai dari tag
11. Type = tipe inputan
Contoh : <input type=”password>
Attribute type pada tag <input> : text, checkbox, file, submit, reset, password.


Berikut script dan hasil latihan membuat Formulir pada HTML :


<html>
<head>
<title>Contoh Formulir</title>
</head>
<body>
<h2>FORMULIR PENDAFTARAN</h2>
<form action="proses.html" method="post"
enctype="multipart/form-data" name="form_reg">
Nama Lengkap : <input type="text" name="nama_lengkap" size="30" maxlength="5" value="Saefur Rohman" required>
<br>
Jenis Kelamin :
<input type="radio" name="jekel" value="Pria"> Pria
<input type="radio" name="jekel" value="Wanita">Wanita
<br>
Hobi :
<input type="checkbox" name="hobi" value="Renang"> Renang
<input type="checkbox" name="hobi" value="Basket"> Basket
<br>
Foto :<input type="file" name="foto">
<br>
Status : <select name="status" size="1">
<option value="Menikah">Menikah</option>
<option value="Belum Menikah">Belum Menikah</option>
</select>
<br>
Alamat :
<textarea name="alamat" rows="5" cols="50"></textarea>
<br>
<br>
<input type="submit" value="SIMPAN" name="bsimpan">
<input type="reset" value="BATAL" name="bbatal">
</form>
</body>
</html>


Dan ini tampilannya :




Sekian rangkuman pertemuan 4 tanggal 2 April 2018 MK : Web Programing 12.2F.21, terima kasih.

Senin, 02 April 2018

BSI Purwokerto - Belajar HTML (Part 2)


PERTEMUAN 3 – 12.2F.21 26 MARET 2018
MEMBUAT TABEL MENGGUNAKAN HTML

TAG <table>
Struktur :
Tabel terdiri dari baris dan kolom
Dalam HTML :
<table> terdiri dari <tr> dan <td>/<td>
<tr> adalah table row (baris table)
<td> adalah table data (isi table)
<th> adalah table heading (judul kolom)
Contoh penerapannya sbb :


Ini artinya tabel terdiri dari 2 baris dan 2 kolom.
ATTRIBUTE HTML <table>,<tr>,<td>,<th>
Penulisan Attribute HTML :
<nama_tag nama_attribute=”isi_attribute”>
Contoh: <table width=”400”

Align = Perataan(center,left,right)
Contoh: <table align=”center”> rata tengah

Width = Lebar (satuan px/piksel/%)
Contoh: <table width=”500px”>
<table width=”30%”>

Border = Garis Tepi (satuan piksel/px)
Contoh: <table border=”5px”>

MENGUBAH WARNA TABEL
<tr (spasi) bgcolor=”grey”> = dalam satu baris (untuk warna bisa langsung menggunakan nama warna dalam b.inggris)
<table bgcolor=”grey”> (semua baris)

Cellspacing = jarak garis tepi dengan garis luar
Contoh: <table cellspacing=”2”>

Cellpadding= jarak garis tepi dalam dengan teks
Contoh : <table cellpadding=”2”>

Rowspan = menggabungkan baris
Contoh : <td rowspan=”3”>

Colspan = menggabungkan kolom
Contoh : <td colspan=”2”>

Target =”_blank” = agar tampilan menjadi di new tab
Title =”Halaman Percobaan”= untuk memunculkan tulisan ketika disorot.
Jika ingin menambahkan gambar, pastikan gambar tersebut berada pada folder yang sama dengan file.html Anda.


MEMBUAT HYPERLINK/LINK

Tag Anchor <a>……</a>
Attribute tag anchor
Href = referensi (alamat web/nama file)
Contoh : <a href=”index.html”>Home</a>
            <a href=http://bsi.ac.id/>Home</a>

Title = tooltip (muncul keterangan saat link di sorot)
Contoh : <a title=”Halaman Beranda”>Home</a>

MENAMPILKAN GAMBAR MENGGUNAKAN HTML
Tag Image <img>
Attribute tag image
Src= source (alamat gambar)
Title = tooltip muncul keterangan saat gambar disorot
Height = Tinggi
Width = Lebar
Alt = keterangan pengganti gambar tidak berhasil diload
Contoh : <img src=”mie ayam.jpg” title=”gambar mie ayam” height=”300” width=”500” alt=”gambar mie ayam”/>

Berikut ini cara penulisan dan hasilnya :


Untuk keterangan kegunaan scriptnya sudah saya jabarkan diatas




Sekian materi pertemuan 3 Web Programing.

BSI Purwokerto-Belajar Membuat Web (part 6) PERCABANGAN PHP ==================================== 1.Percabangan IF,yaitu mengeksekusi t...