PHP is a programming language for dynamically built web sites. PHP used to stand for PHP: Hypertext Preprocessor. At download-latest-drivers.blogspot you can find the webs largest directory of PHP scripts for purchase or free downloads. You can also find plenty of PHP tutorials, applications, development software,books and much, much more.
If you dont find the PHP script your looking for try our Script Request forum for assistance in finding what youre looking for.
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
Tuesday, August 30, 2016
Cara Membuat Perulangan Bilangan Segitiga Menggunakkan For dan While pada PHP
Cara Membuat Perulangan Bilangan Segitiga Menggunakkan For dan While pada PHP

Assalammualaikum Wr. Wb.
Kali ini saya akan mengeshare Cara Membuat Perulangan Bilangan Segitiga Menggunakkan For dan While pada PHP. sebelumnya komputer/laptop anda harus terinstall XAMPP dan Notepad++ terlebih dahulu. Jika sudah terinstall silahkan buat file .php menggunakan Notepad++ Anda.
- Sebelum copy paste silahkan buat folder di C:/xampp/htdocs/ dengan nama folder perulangan.
- Sebelumnya kita buat dulu css nya. biar tampilannya tidak seperti zaman purba.
body{
color:#000;
background:-webkit-linear-gradient(top,red,orange,yellow,green);
background:-moz-linear-gradient(top,red,orange,yellow,green);
background:-o-linear-gradient(top,red,orange,yellow,green);
background-attachment:fixed;
font-size:18px;
font-family: Tahoma, sans-serif;
margin:0;
padding:48px;
}
h2{
color:blue;
}
h2:hover{
color:red;
}
a,a:visited{
color:blue;
text-decoration:none;
}
a:hover{
color:red;
text-shadow:0 2px 6px #888;
}
.panel{
max-width:480px;
background-color:skyblue;
margin:1px auto 1px;
padding:24px;
border-radius:8px;
-webkit-border-radius:8px;
-moz-border-radius:8px;
box-shadow:0 4px 8px #000;
}
input{
border-radius:8px;
-webkit-border-radius:8px;
-moz-border-radius:8px;
font-size:18px;
padding:8px 14px;
margin:0 1px;
border:1px solid #888;
}
.field{
width:320px;
}
.tombol{
color:#fff;
background-color:#000;
}
.tombol:hover{
background-color:orange;
}
- Simpan di C:/xampp/htdocs/perulangan dengan nama style.css
A. MEMBUAT PERULANGAN BILANGAN SEGITIGA MENGGUNAKKAN FOR
- Silahkan copy dan paste script dibawah :
<html>
<head>
<title>Perulangan Segitiga Menggunakan For pada PHP</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<?php
date_default_timezone_set(Asia/Jakarta);
$bil = isset($_POST[bil]) ? $_POST[bil] : NULL;
echo <div class="panel">;
echo <h2>Perulangan Menggunakan For</h2>;
echo date("l, d-M-Y H:i:s");
echo <hr>;
echo <h4>Masukkan Bilangan :</h4>;
echo <form action="" method="post">;
echo <input class="field" type="text" name="bil" value=".$bil." placeholder="Masukkan Bilangan..."/>;
echo <input class="tombol" type="submit" name="submit" value="OK"/>;
echo </form>;
if((isset($bil))and($bil!=NULL)){
echo <h4>Hasil Perulangan :</h4>;
for($i=1;$i<=$bil;$i++){
for($j=1;$j<=$i;$j++){
echo $i;
}
echo <br/>;
}
}
echo <hr>;
echo <a href="../">« Kembali</a>;
echo <hr>;
echo <center><a href="http://syahrulzzadie.blogspot.com" target="blank_">© Syahrulzzadie</a></center>;
echo </div>;
?>
</body>
</html>
- Simpan di C:/xampp/htdocs/perulangan dengan nama for.php
- Silahkan Buka web browser anda (Google Chrome atau Mozilla). lalu ketikan http://localhost/perulangan/for.php
- Maka hasilnya seperti ini:
B. MEMBUAT PERULANGAN BILANGAN SEGITIGA MENGGUNAKKAN WHILE
- Silahkan copy dan paste script dibawah :
<html>
<head>
<title>Perulangan Menggunakan While pada PHP</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<?php
date_default_timezone_set(Asia/Jakarta);
$bil = isset($_POST[bil]) ? $_POST[bil] : NULL;
echo <div class="panel">;
echo <h2>Perulangan Menggunakan While</h2>;
echo date("l, d-M-Y H:i:s");
echo <hr>;
echo <h4>Masukkan Bilangan :</h4>;
echo <form action="" method="post">;
echo <input class="field" type="text" name="bil" value=".$bil." placeholder="Masukkan Bilangan..."/>;
echo <input class="tombol" type="submit" name="submit" value="OK"/>;
echo </form>;
if((isset($bil))and($bil!=NULL)){
echo <h4>Hasil Perulangan :</h4>;
$i=0;
while($i<$bil){
$i++;
$j=0;
while($j<$i){
$j++;
echo $i;
}
echo <br/>;
}
}
echo <hr>;
echo <a href="../">« Kembali</a>;
echo <hr>;
echo <center><a href="http://syahrulzzadie.blogspot.com" target="blank_">© Syahrulzzadie</a></center>;
echo </div>;
?>
</body>
</html>
- Simpan di C:/xampp/htdocs/perulangan dengan nama while.php
- Silahkan Buka web browser anda (Google Chrome atau Mozilla). lalu ketikan http://localhost/perulangan/while.php
- Maka hasilnya seperti ini:
Atau Anda juga bisa Download ZIP filenya disini.
Sekian dari saya, Terima kasih telah berkunjung. Semoga Bermanfaat bagi Anda.
Wassalammualaikum Wr. Wb.
Monday, August 29, 2016
PHP
PHP
Subcategories
Scripts & Programs
(9,756)Categorized database of scripts and programs written in PHP.
Tutorials & Tips
(659)Online tutorials and guidelines on how to program in PHP.
Web Sites
(320)Sites and archives offering a variety of PHP scripts and resources.
Software & Servers
(257)Software and servers to aid in PHP development.
Web Developers
(160)List of PHP programming agencies and freelancers.
Programming Books
(98)Selections of PHP programming-related books.
Forums & Online Communities
(63)Share tips and ideas on PHP programming with other developers.
Frameworks
(60)Resources on different PHP Frameworks
Magazine Articles
(20)Online magazine articles on various aspects of PHP development.
Labels:
php
Cara Membuat Perulangan Menghitung Faktorial For While dan Do While pada PHP
Cara Membuat Perulangan Menghitung Faktorial For While dan Do While pada PHP

Assalammualaikum Wr. Wb..
Kali ini saya akan mengeshare Cara Membuat Perulangan Menghitung Faktorial For While dan Do While pada PHP. sebelumnya komputer/laptop anda harus terinstall XAMPP dan Notepad++ terlebih dahulu. Jika sudah terinstall silahkan buat file .php menggunakan Notepad++ Anda.
- Sebelum copy paste silahkan buat folder di C:/xampp/htdocs/ dengan nama folder perulangan.
- Sebelumnya kita buat dulu css nya. biar tampilannya tidak seperti zaman purba.
body{
color:#000;
background:-webkit-linear-gradient(top,red,orange,yellow,green);
background:-moz-linear-gradient(top,red,orange,yellow,green);
background:-o-linear-gradient(top,red,orange,yellow,green);
background-attachment:fixed;
font-size:18px;
font-family: Tahoma, sans-serif;
margin:0;
padding:48px;
}
h2{
color:blue;
}
h2:hover{
color:red;
}
a,a:visited{
color:blue;
text-decoration:none;
}
a:hover{
color:red;
text-shadow:0 2px 6px #888;
}
.panel{
max-width:480px;
background-color:skyblue;
margin:1px auto 1px;
padding:24px;
border-radius:8px;
-webkit-border-radius:8px;
-moz-border-radius:8px;
box-shadow:0 4px 8px #000;
}
input{
border-radius:8px;
-webkit-border-radius:8px;
-moz-border-radius:8px;
font-size:18px;
padding:8px 14px;
margin:0 1px;
border:1px solid #888;
}
.field{
width:320px;
}
.tombol{
color:#fff;
background-color:#000;
}
.tombol:hover{
background-color:orange;
}
- Simpan di C:/xampp/htdocs/perulangan dengan nama style.css
A. MEMBUAT PERULANGAN MENGHITUNG FAKTORIAL MENGGUNAKAN FOR
- Silahkan copy paste script berikut :
<html>
<head>
<title>Menghitung Bilangan Faktorial menggunakan For pada PHP</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<?php
$n = isset($_POST[n]) ? $_POST[n] : NULL;
if(isset($_POST[submit])){
if($n!=NULL){
$bil = 1;
for($i=1;$i<=$n;$i++){
$bil = $bil*$i;
}
}else{
$bil = Bilangan Tidak boleh kosong mblo!;
}
}
date_default_timezone_set(Asia/Jakarta);
echo <div class="panel">;
echo <h2>Menghitung Bilangan Faktorial menggunakan For</h2>;
echo date("l, d-M-Y H:i:s");
echo <hr>;
echo <h4>Masukkan Bilangan :</h4>;
echo <form action="" method="post">;
echo <input class="field" type="text" name="n" value=".$n." placeholder="Masukkan Bilangan..."/>;
echo <input class="tombol" type="submit" name="submit" value="Hitung"/>;
echo </form>;
if((isset($n))and($n!=NULL)){
echo <h4>Hasil Faktorial :</h4>;
echo => ;
for($i=1;$i<$n;$i++){echo $i.x;}
echo $n;
echo <br/>;
}
echo <h4>Jumlah Faktorial :</h4>;
echo <input class="field" type="text" value=".(isset($bil) ? $bil : NULL)." readonly/>;
echo <hr>;
echo <a href="../">« Kembali</a>;
echo <hr>;
echo <center><a href="http://syahrulzzadie.blogspot.com" target="blank_">© Syahrulzzadie</a></center>;
echo </div>;
?>
</body>
</html>
- Simpan di C:/xampp/htdocs/perulangan dengan nama for.php
- Silahkan Buka web browser anda (Google Chrome atau Mozilla). lalu ketikan http://localhost/perulangan/for.php
- Maka hasilnya seperti ini :
B. MEMBUAT PERULANGAN MENGHITUNG FAKTORIAL MENGGUNAKAN WHILE
- Silahkan copy paste script berikut:
<html>
<head>
<title>Menghitung Bilangan Faktorial menggunakan While pada PHP</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<?php
$n = isset($_POST[n]) ? $_POST[n] : NULL;
if(isset($_POST[submit])){
if($n!=NULL){
$bil = 1;
$i=0;
while($i<$n){
$i++;
$bil = $bil*$i;
}
}else{
$bil = Bilangan Tidak boleh kosong mblo!;
}
}
date_default_timezone_set(Asia/Jakarta);
echo <div class="panel">;
echo <h2>Menghitung Bilangan Faktorial menggunakan While</h2>;
echo date("l, d-M-Y H:i:s");
echo <hr>;
echo <h4>Masukkan Bilangan :</h4>;
echo <form action="" method="post">;
echo <input class="field" type="text" name="n" value=".$n." placeholder="Masukkan Bilangan..."/>;
echo <input class="tombol" type="submit" name="submit" value="Hitung"/>;
echo </form>;
if((isset($n))and($n!=NULL)){
echo <h4>Hasil Faktorial :</h4>;
echo => ;
$i=0;
while($i<$n-1){
$i++;
echo $i.x;
}
echo $n;
echo <br/>;
}
echo <h4>Jumlah Faktorial :</h4>;
echo <input class="field" type="text" value=".(isset($bil) ? $bil : NULL)." readonly/>;
echo <hr>;
echo <a href="../">« Kembali</a>;
echo <hr>;
echo <center><a href="http://syahrulzzadie.blogspot.com" target="blank_">© Syahrulzzadie</a></center>;
echo </div>;
?>
</body>
</html>
- Simpan di C:/xampp/htdocs/perulangan dengan nama while.php
- Silahkan Buka web browser anda (Google Chrome atau Mozilla). lalu ketikan http://localhost/perulangan/while.php
- Maka hasilnya seperti ini :
C. MEMBUAT PERULANGAN MENGHITUNG FAKTORIAL MENGGUNAKAN DO WHILE
- Silahkan copy dan paste script berikut:
<html>
<head>
<title>Menghitung Bilangan Faktorial menggunakan Do While pada PHP</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<?php
$n = isset($_POST[n]) ? $_POST[n] : NULL;
if(isset($_POST[submit])){
if($n!=NULL){
$bil = 1;
$i=1;
do
{
$bil = $bil*$i;
$i++;
}
while($i<=$n);
}else{
$bil = Bilangan Tidak boleh kosong mblo!;
}
}
date_default_timezone_set(Asia/Jakarta);
echo <div class="panel">;
echo <h2>Menghitung Bilangan Faktorial menggunakan Do While</h2>;
echo date("l, d-M-Y H:i:s");
echo <hr>;
echo <h4>Masukkan Bilangan :</h4>;
echo <form action="" method="post">;
echo <input class="field" type="text" name="n" value=".$n." placeholder="Masukkan Bilangan..."/>;
echo <input class="tombol" type="submit" name="submit" value="Hitung"/>;
echo </form>;
if((isset($n))and($n!=NULL)){
echo <h4>Hasil Faktorial :</h4>;
echo => ;
$i=1;
do{
echo $i.x;
$i++;
}while($i<$n);
echo $n;
echo <br/>;
}
echo <h4>Jumlah Faktorial :</h4>;
echo <input class="field" type="text" value=".(isset($bil) ? $bil : NULL)." readonly/>;
echo <hr>;
echo <a href="../">« Kembali</a>;
echo <hr>;
echo <center><a href="http://syahrulzzadie.blogspot.com" target="blank_">© Syahrulzzadie</a></center>;
echo </div>;
?>
</body>
</html>
- Simpan di C:/xampp/htdocs/perulangan dengan nama do_while.php
- Silahkan Buka web browser anda (Google Chrome atau Mozilla). lalu ketikan http://localhost/perulangan/do_while.php
- Maka hasilnya seperti ini :
Atau Anda juga bisa Download ZIP filenya disini.
Sekian dari saya, Terima kasih telah berkunjung. Semoga Bermanfaat.
Wassalammualaikum Wr. Wb.
Contoh Kuis Menghitung Operasi Aritmatika Menggunakan PHP
Contoh Kuis Menghitung Operasi Aritmatika Menggunakan PHP

Kali ini saya akan membagikan contok script mengitung opreasi aritmatika menggunakan PHP.
Sebagai Contoh :
Toko Bangunan Abadi Jaya menjual :
Cat A : 75,000/kaleng
Cat B : 125,000/kaleng
Cat C : 250,000/kaleng
Pak budiman ingin membeli Cat B sebanyak 2 kaleng dan cat C 3 kaleng.
Dalam setiap pembelian di toko ini, pembeli dikenakan pajak PPN sebesar 10%.
Yuk, bantu Pak Budiman untuk menghitung harga totalnya.
Untuk menjawab penyataan diatas kita harus membuat variabel-variabel pada soal diatas.
untuk lebih lengkapnya. Berikut Script PHP nya :
<?php
echo <h1>Kuis Aritmatika</h1>;
$cat_a = 75000;
$cat_b = 125000;
$cat_c = 250000;
$beli = (($cat_b*2)+($cat_c*3));
$ppn = $beli*(10/100);
$bayar = $beli+$ppn;
$bayar = number_format($bayar,2);
$beli = number_format($beli,2);
$ppn = number_format($ppn,2);
echo Harga Normal : Rp. .$beli.<br/>;
echo PPN : Rp. .$ppn.<br/>;
echo Harga Totalnya : Rp. .$bayar;
?>
Copy Script diatas, lalu Paste kan di Notepad++ dan Jalankan di Web browser localhost anda.
Maka hasilnya seperti ini :

Wassalamualaikum Wr.Wb.
Labels:
aritmatika,
contoh,
kuis,
menggunakan,
menghitung,
operasi,
php
Cara Membuat Kalkulator Menggunakan Script PHP dan CSS Sederhana
Cara Membuat Kalkulator Menggunakan Script PHP dan CSS Sederhana

Assalammualaikum Wr. Wb.
Kali ini saya akan share Cara Membuat Kalkulator Menggunakan Script PHP dan CSS Sederhana. sebelumnya kita harus menginstall XAMPP terlebih dahulu agar bisa membuka file .php nya.. jika sudah langsung saja saya bagi scriptnya.
Script PHP Kalkulator:
<html>Atau download saja Scriptnya disini (Download ZIP)
<head>
<title>Kalkulator Sederhana</title>
<style>
body{
color:#000;
background-image:url(background.jpg);
background-size:full;
background-color:#fff;
font-family:Tahoma, sans-serif;
font-size:18px;
margin:0;
padding:0;
}
input{
font-size:24px;
padding:6px;
border: 1px solid #000;
}
.panel{
background-color:skyblue;
box-shadow:0 2px 5px #000;
padding:18px;
line-height:28px;
margin:150px auto 2px;
max-width:380px;
}
.tombol{
color:#fff;
font-size:14px;
background-color:#212121;
boder-bottom:2px solid #000;
padding:8px;
margin:2px;
}
.tombol:hover{
background-color:orange;
}
a{
text-decoration:none;
color: #F57C00;
}
.footer{
max-width: 100%;
padding: 10px;
color: lime;
}
</style>
</head>
<body>
<?php
$bil1 = isset($_POST[bil1]) ? $_POST[bil1] : NULL;
$bil2 = isset($_POST[bil2]) ? $_POST[bil2] : NULL;
$hasil = isset($hasil) ? $hasil : 0;
if(isset($_POST[tambah])){
$hasil = $bil1+$bil2;
}
if(isset($_POST[kurang])){
$hasil = $bil1-$bil2; }
if(isset($_POST[kali])){
$hasil = $bil1*$bil2;
}
if(isset($_POST[bagi])){
$hasil = $bil1/$bil2;
}
if(isset($_POST[clear])){
$hasil=;
$bil1=;
$bil2=;
}
if(isset($_POST[sqrt])){
$hasil=sqrt($bil1);
}
if(isset($_POST[^2])){
$hasil=($bil1*$bil1);
}
if(isset($_POST[%])){
$hasil=($bil1*$bil2)/100;
}
if(isset($_POST[1/x])){
$hasil=(1/$bil1);
}
echo <div class="panel">.
<form action="" method="post">.
<div align="center"> KALKULATOR SEDERHANA </div>.
<div align="center">=============================</div>.
<b>MASUKAN BILANGAN KE-1:</b><br/>.
<input type="text" name="bil1" value=".$bil1."/><br/>.
<b>MASUKAN BILANGAN KE-2:</b><br/>.
<input type="text" name="bil2" value=".$bil2."/><br/>.
<input class="tombol" type="submit" name="tambah" value="+"/>.
<input class="tombol" type="submit" name="kurang" value="-"/>.
<input class="tombol" type="submit" name="kali" value="X"/>.
<input class="tombol" type="submit" name="bagi" value=":"/>.
<INPUT class="tombol" type="submit" name="clear" value="C"/>.
<input class="tombol" type="submit" name="sqrt" value="sqrt"/>.
<input class="tombol" type="submit" name="^2" value="^2"/>.
<input class="tombol" type="submit" name="%" value="%"/>.
<input class="tombol" type="submit" name="1/x" value="1/X"/><br/>.
</form>.
<b>HASIL:</b><br/>.
<input type="text" value=".$hasil." readonly/><br/>.
</div>;
?><br/><br/><br/><br/><br/>
<div class="footer">
Copyright © 14090008 & 14090018 | <a href="https://naufalhanifalbani.wordpress.com/">naufalhanifalbani.wordpress.com</a>, <a href="https://syahrulzzadie.blogspot.com/">syahrulzzadie.blogspot.com</a> | Jangan Lupa Kunjungi Blog Kami yaaa..
</div>
</body>
</html>
Copy dan Paste di Notepad++ lalu Simpan Sebagai index.php di folder C:/xampp/htdocs/kalkulator/"taruh disini" (kalau belum ada folder kalkulator, buat sendiri saja).
Setelah disimpan, buka browser anda lalu ketikan http://localhost/kalkulator/ kemudian enter.
Berikut beberapa screenshot tampilan kalkulatornya :
- Tampilan Utama Kalkulator.

- Operasi hitung Penambahan.
- Tampilan Operasi Hitung Pengurangan.

- Tampilan Operasi Hitung Perkalian.

- Tampilan Operasi Hitung Pembagian.

- Tampilan Tombol C / Clear.

- Tampilan Fungsi sqrt / Akar kuadrat.

- Tampilan Fungsi Bilangan Kuadrat.

- Tampilan Fungsi Tombol Persen.

- Tampilan Fungsi 1/X. 1 dibagi Bilangan Input.

Wassalammualaikum Wr. Wb..
Labels:
cara,
css,
dan,
kalkulator,
membuat,
menggunakan,
php,
script,
sederhana
Subscribe to:
Posts (Atom)